Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> question ???

question ???

From: Norman Dunbar <Norman.Dunbar_at_lfs.co.uk>
Date: Tue, 25 Sep 2001 17:52:58 +0100
Message-ID: <A43AA78C3F9DD511AAB100805FBE740D45507F@lnewton.leeds.lfs.co.uk>


How about :

creating a sequence (see CREATE SEQUENCE ...) to give you a unique number for each insert into the table, then create a trigger on the table for before insert and in the trigger, check that the PK column is null, and if so, get the next sequence number from the sequence and load it into the column.

But this produces a 'meaningless' primary key value wheras the table should (really) have a more meaningfule one based upon the data in said table. (Or so I'm told by Data Designers)

HTH. Norman.



Norman Dunbar			EMail:	Norman.Dunbar_at_LFS.co.uk
Database/Unix administrator	Phone:	0113 289 6265
				Fax:	0113 289 3146
Lynx Financial Systems Ltd.	URL:	http://www.Lynx-FS.com

------------------------------------------------------------------------

-----Original Message-----

From: Serge Nantel [mailto:snantel_at_virtuo-cio.com] Posted At: Tuesday, September 25, 2001 3:50 PM Posted To: server
Conversation: question ???
Subject: question ???

Oracle have a pakage or procedures to generate PK by him self ???

Thanks Received on Tue Sep 25 2001 - 11:52:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US