kellie hobbs
2006-03-22 20:09:17 UTC
Hello,
I am trying to get back the id of a record after inserting it into the
table. My Oracle database has a trigger that automatically creates the
id on insert. The PL/SQL statement that works for me is:
SQL> declare id int;
2 begin
3 insert into table (field) values ('foo') returning tableid into
id;
4 dbms_output.put_line(id);
5 end;
6 /
How can I run this through cx_oracle and get the id stored in a
variable so I can use it?
Many thanks.
Kellie Hobbs, UC Berkeley
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
I am trying to get back the id of a record after inserting it into the
table. My Oracle database has a trigger that automatically creates the
id on insert. The PL/SQL statement that works for me is:
SQL> declare id int;
2 begin
3 insert into table (field) values ('foo') returning tableid into
id;
4 dbms_output.put_line(id);
5 end;
6 /
How can I run this through cx_oracle and get the id stored in a
variable so I can use it?
Many thanks.
Kellie Hobbs, UC Berkeley
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com