On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote:
> Heh. It's a little more complicated than that. You have to create a
> BEFORE INSERT trigger to read the next value from the sequence and set
> the ID to it.

Well, whatever gymnastics the db owner has to go through to set up the
tables in the first place, that's not RDBO's problem.  (Edit: maybe it
is...see below.)

> This does preclude the option of setting the ID specifically in the query as
> it will be overwritten.

But I can pass a value, right?  Or do I have to pass NULL for that column?

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?

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.  As for concurrency, I'm not sure what do to
there...

>> Does DBD::Oracle support all of DBI's various *_info() methods correctly?
>> That alone would make auto-init 90% done, since the default Auto.pm
>> implementation just uses DBI's native introspection. All we'd have to add is
>> unique key extraction.
>>
> It should. Or, put it this way - I would be shocked if it didn't. Remember -
> Tim supports both DBI and DBD::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().

-John


-------------------------------------------------------
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&kid3432&bid#0486&dat1642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to