Message-Id: <10556.111826@fatcity.com> From: Zhong Hong Date: Wed, 12 Jul 2000 09:54:43 -0700 Subject: RE: sequences This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01BFEC21.E08E7130 Content-Type: text/plain; charset="iso-8859-1" I use sequence as much as possible. Triggers slow down the write. Zhong It's another beautiful day! -----Original Message----- From: Glenn Travis [mailto:Glenn.Travis@wcom.com] Sent: Wednesday, July 12, 2000 10:23 AM To: Multiple recipients of list ORACLE-L Subject: sequences I wanted to ask how people are handling the insertion of unique keys in Oracle. Please understand that my experience with generating unique keys comes from an Informix background, wherein you can have a column with datatype of 'serial'. This is an integer column which gets generated at insert time with the next value automatically. You can then check the sqlca area (return buffer) for the inserted value. I know in Oracle you can accomplish this with the SEQUENCE function. As this is not automatically inserted by Oracle, how is the unqiue key value inserted? Do most people use a before trigger, stored procs, or call the sequence themselves? If using a client program (c, java), how is the value for the unique key returned to the program which performed the insert? Examples, methods, design recommendations welcome... ------_=_NextPart_001_01BFEC21.E08E7130 Content-Type: text/html; charset="iso-8859-1"
I use sequence as much as possible. Triggers slow down the write.
 

Zhong
It's another beautiful day!

-----Original Message-----
From: Glenn Travis [mailto:Glenn.Travis@wcom.com]
Sent: Wednesday, July 12, 2000 10:23 AM
To: Multiple recipients of list ORACLE-L
Subject: sequences

I wanted to ask how people are handling the insertion of unique keys in Oracle.  Please understand that my experience with generating unique keys comes from an Informix background, wherein you can have a column with datatype of 'serial'.  This is an integer column which gets generated at insert time with the next value automatically.  You can then check the sqlca area (return buffer) for the inserted value.
 
I know in Oracle you can accomplish this with the SEQUENCE function.  As this is not automatically inserted by Oracle, how is the unqiue key value inserted?  Do most people use a before trigger, stored procs, or call the sequence themselves?  If using a client program (c, java), how is the value for the unique key returned to the program which performed the insert?
 
Examples, methods, design recommendations welcome...