Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> primary and foreign keys
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
![]() |
![]() |