l*****k 发帖数: 587 | 1 in oracle, I am trying to design a database, I am facing a problem in
preventing duplicate numbers.
I make several table to generate their own PK upon insertion,
some tables's PK will be used as FK by other table(s). How do I
prevent an careless insertion that produce another PK for the
same row??? can I boundle other fields with PK?
If I want to write a scripts that insert FK automatically to other
table upon generation in parent table, then only do updates to those
table, will this be a good s | a*****a 发帖数: 438 | 2 dont fully understand your question. but you can create a PK with
more than 1 col.. forgot what's that called now. a com.... pk
【在 l*****k 的大作中提到】 : in oracle, I am trying to design a database, I am facing a problem in : preventing duplicate numbers. : I make several table to generate their own PK upon insertion, : some tables's PK will be used as FK by other table(s). How do I : prevent an careless insertion that produce another PK for the : same row??? can I boundle other fields with PK? : If I want to write a scripts that insert FK automatically to other : table upon generation in parent table, then only do updates to those : table, will this be a good s
| m**c 发帖数: 90 | 3
Why don't you create a single table to keep track the PK - This table will
have only one column - ID, and everytime you need to create a new PK for any
table, just take the value of ID and then increase it by 1 (so next time you
will get different value), this way, every PK will be unqiue cross whole
schema.
【在 l*****k 的大作中提到】 : in oracle, I am trying to design a database, I am facing a problem in : preventing duplicate numbers. : I make several table to generate their own PK upon insertion, : some tables's PK will be used as FK by other table(s). How do I : prevent an careless insertion that produce another PK for the : same row??? can I boundle other fields with PK? : If I want to write a scripts that insert FK automatically to other : table upon generation in parent table, then only do updates to those : table, will this be a good s
| l*****k 发帖数: 587 | 4 My auto_increment PK is implemented by sequence, there are several
sequences that keep track of different PKs in different table.
all the confusion is generated by user request, they strongly
ask for parallel use of their naming system... I will reformulate
my question later...
right now, I am having problem with my trigger generating script, some
trigger compile with error, while some went through fine... really weird
【在 m**c 的大作中提到】 : : Why don't you create a single table to keep track the PK - This table will : have only one column - ID, and everytime you need to create a new PK for any : table, just take the value of ID and then increase it by 1 (so next time you : will get different value), this way, every PK will be unqiue cross whole : schema.
|
|