I did find a reference for oracle 8.0 that supports returning clause...

I've moved this to a ticket request in trac:
http://www.sqlalchemy.org/trac/ticket/1878

On 8/14/2010 11:14 AM, Kent Bower wrote:
Not a myth, I'm using them (via sqla). Simple views (just one table) oracle figures out writes to all alone. For more complex views (joins of tables), you can use an "INSTEAD OF" trigger to write to the view (just pl/sql trigger where you tell Oracle what you want to happen when someone inserts/updates/deletes data in your view)... also using them, not a myth.

Anyway, here is documentation from oracle.com, so at least we know 8.1.7 supported it: http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a85397/state11c.htm#2066261

(I think they added fancier bulk returns and the like in later versions...)

Kent


On 8/14/2010 10:42 AM, Michael Bayer wrote:
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