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 -> primary and foreign keys

primary and foreign keys

From: Ronnie Braverman <Ronnie.Braverman_at_dsto.defence.gov.au>
Date: Thu, 30 Jul 1998 12:03:58 +1000
Message-ID: <35BFD48E.10B1D83D@dsto.defence.gov.au>


Hi there.
I have table X with the primary key PK_X consisting of five columns.
I have table Y with a foreign key FK_Y the same columns as those in PK_X.
Since the number of rows in Y is going to be huge, I'd like to avoid duplicating the key columns in both tables X and Y. What I would like to have is some unique id (eg a unique number) being generated for every row in table X which I could then use as the primary key for X and the foreign key for Y. The problem is that I do not know how to generate a unique id (other than the [maximum of the column] + 1, but since the number of rows are going to be huge and rows will be added and deleted continuously, this is not a good long term solution). Any ideas?
Thanks,
ronnie Braverman Received on Wed Jul 29 1998 - 21:03:58 CDT

Original text of this message

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