John Siracusa wrote:
Either way, after the insert, I'll need a way to get the value that
was used--and do so in a concurrency-safe way. What's The Oracle Way
to do that?
In my experience, it's best way is to select the nextval from the
sequence before doing the insert, and then providing that value to the
insert statement. I'm not sure if last_insert_id() works with
DBD::Oracle (never tried it).
It's sounding like the person setting up the RDBO class will have to
explicitly name the sequence used, so RDBO knows which sequence to get
the last value of.
I would recommend that approach. Maybe with some default auto-guessing
of the name of the sequence. I have not seen a SERIAL column type in
Oracle.
Unfortunately, now it's sounding like we'll have to try to parse(?!)
the BEFORE INSERT triggers to try to dig out the sequence names.
Otherwise, auto-init-ed classes won't know how to get their PK values
after a save().
I would recommend, on the first pass at least, to not worry about BEFORE
INSERT triggers. Just get:
select <SEQUENCE_NAME>.nextval from dual;
working before the insert statement, where SEQUENCE_NAME is specified by
the user.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object