On Aug 14, 2010, at 9:34 AM, Kent wrote:

> I'm connecting to a legacy database, some tables that I need to map in
> sqla have no primary key.  I've created views for such tables that map
> the ROWID as the primary key.  SQLAlchemy does a RETURNING clause when
> I am connected to a more recent Oracle database, but not when
> connected to 8i.
> 
> I've pasted the exact same code sqla compiled for newer oracle into an
> 8i session and it works fine:
> 
> {{{
> Connected to:
> Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
> With the Partitioning option
> JServer Release 8.1.7.4.0 - Production
> 
> SQL> show release
> release 801070400
> }}}
> {{{
> ...(set up variables in sqlplus)...
> SQL> INSERT INTO artransarchive (customerid, companyid, orderid,
> adjinvoice, transactioncodeid, status, paymenttypeid, postdate,
> amount, sourcesiteid, artype) VALUES
> (:customerid, :companyid, :orderid, :adjinvoice, :transactioncodeid, :status, 
> :paymenttypeid, :postdate, :amount, :sourcesiteid, :artype)
> RETURNING artransarchive.artransarchiveid INTO :ret_0
>  2  ;
> 
> 1 row created.
> 
> SQL> print ret_0
> 
> RET_0
> -------------------------------------------------------------
> AAAAzbAADAAARwDAAZ
> 
> SQL> show release
> release 801070400
> SQL>
> }}}
> 
> Are there other problems that restricted the use of RETURNING with
> oracle 8i, or was it believed to not be supported?  (Note that I don't
> believe Oracle 8.0 supports it... I read it was implemented in 8i)

I probably went off of this: 
http://www.lattimore.id.au/2006/04/06/oracle-returning-clause/ which says its 
as of 10g.    If we can get confirmation somewhere of when RETURNING was 
introduced we can lower the "auto-returning-on-insert" threshhold; though its 
not clear that its really a better method to use with oracle, so perhaps here 
since you have some special use we would allow it to be enabled manually on any 
version.

though if you're mapping to a view, these are writeable views ?   i thought 
those were only in myth.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to