Wow. Great work. That didn't take long...
On 7/18/07, Willi Langenberger <[EMAIL PROTECTED]> wrote:
> According to Gustavo Niemeyer:
> > > I think this can also be used with the Oracle Call Interface, ie
> > > something like:
> > >
> > > rowid = cursor.execute("""INSERT INTO some_table
> > > (col1, col2) VALUES (:1, :2)
> > > RETURNING ROWID INTO :3""", col1, col2)
> >
> > Can you check if that really works?
>
> Tested with DCOracle2::
>
> import random
> import DCOracle2
>
> dbc = DCOracle2.connect('...')
> cursor = dbc.cursor()
>
> foo = random.randint(0, 10000)
> print 'inserting:', foo
> sql = """insert into test_table (foo) values (:1)
> returning rowid into :out_rowid"""
> rowid = cursor._connection.rowid() # empty rowid object
> cursor.execute(sql, foo, out_rowid=rowid) # put rowid value into it
>
> # now reading the record with the rowid from the last statement
> sql = """select foo from test_table
> where rowid = :1"""
> cursor.execute(sql, rowid)
>
> foo2, = cursor.fetchone()
> print 'reading:', foo2
>
> This seems to work.
>
> Whats left is finding a way to catch the INSERT statements in the
> oracle backend and wrap the rowid magic around it.
>
>
> \wlang{}
>
> --
> [EMAIL PROTECTED] Fax: +43/1/31336/9207
> Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria
>
> --
> storm mailing list
> [email protected]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/storm
>
--
http://www.blog.noahgift.com
--
storm mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/storm