Ok, I think there are a couple options here. 

 

The quickest and easiest would be to say that Oracle users need to manage their own Key values.  If they have a sequence then they need to write their own methods to get the next values and set them into the record before saving

 

Another option would be to make a generic construct:

 

<object name=”User” sequence=”UserSequence”>

            ….

</object>

 

In the case of Oracle it’d use the UserSequence to get the next id for Users.  This is pretty generic too, because Posgres might be able to use this too.  In the case the the dbms doesn’t support sequences then this would be ignored.

 

Doug

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Kotek
Sent: Tuesday, February 21, 2006 8:18 AM
To: [email protected]
Subject: Re: [Reactor For CF] Oracle support for Reactor

 

Perhaps something user-configurable in the <config> set specifically for Oracle (or any other DBs that don't have autonumber)? Maybe something like this (with autonumber as the default if this tag wasn't specified):

      <config>
            <dsn value="Scratch" />
            <type value="oracle" />
            <pktype value="autonumber|sequence|uuid" />

            <mapping value="/ScratchData" />
            <mode value="development" />
      </config>

The trick with sequence seems to be, how do you tell Reactor where to get the next sequence value. Is there one for each table or a global one for each project that is used for all tables? Are the sequences named by convention ie "seq_customers" or would one have to specify the sequence to be used for each table?

On 2/21/06, Bowden, Beth (NIH/NIEHS) [E] <[EMAIL PROTECTED]> wrote:

I don't know of an Oracle column type that behaves like a sequence
unless she meant adding a trigger.

In Oracle, you can define a trigger on a column that will take the next
sequence value and insert it into the column. The issue I have is
returning that key.  Since Oracle doesn't have the "Identity" or
"autonumber", it also doesn't have the corresponding LAST_INSERT_ID() or
SCOPE_IDENTITY() functions.

Another thought is to use UUID for keys.

Beth Bowden

Phone: 919-541-3355 FAX: 919-541-3687
E-Mail: [EMAIL PROTECTED]
Address: NIEHS, MD EC-03, P.O. BOX 12233, Research Triangle Park, NC
27709

-----Original Message-----
From: Sean Corfield [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 21, 2006 1:55 AM
To: [email protected]
Subject: Re: [Reactor For CF] Oracle support for Reactor

On 2/20/06, Doug Hughes <[EMAIL PROTECTED]> wrote:
> So, when working with oracle you need to create your IDs ahead of
time?
>
> In PostgreSQL they use sequences too.  However, I think you can define
a
> default of the next value from a sequence to a column.  (It's been a
while,
> forgive me if I'm wrong.)
>
> Is there anything like that in Oracle?

I just chatted to one of my Oracle DBA friends (she's in India looking
after her mother right now) and she says that there is a column type
that behaves like a sequence number but I suspect that isn't the
default way that legacy databases are created in Oracle. For the most
part, I've used a dedicated SEQUENCE as Beth indicates. Not sure how
to make this clean and generic across multiple DBs.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/




-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/


-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

Reply via email to