由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - database design issue
相关主题
SQL问题求救!!请教一个sqlplus的问题
Oracle table 备份问题sql server里怎么create 跨database的 view
请帮我看看,什么地方错了?MS T-SQL 问题
how to using sql generate sql statements?请教个数据管理的问题
How to handle inserting value to Identity column in sql server 2005Oracle下如何能得到所有table的名字?
urgent help! insert value into tableAbout INSERT IGNORE
Can I create thousands table in one...MySQL row selection question
Help on Sql server huge table performance问个笨问题
相关话题的讨论汇总
话题: pk话题: table话题: fk话题: database话题: design
进入Database版参与讨论
1 (共1页)
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.

1 (共1页)
进入Database版参与讨论
相关主题
问个笨问题How to handle inserting value to Identity column in sql server 2005
How to monitor the data loading status?urgent help! insert value into table
SQL问题请教: add one more columnCan I create thousands table in one...
SQL Server stupid questionsHelp on Sql server huge table performance
SQL问题求救!!请教一个sqlplus的问题
Oracle table 备份问题sql server里怎么create 跨database的 view
请帮我看看,什么地方错了?MS T-SQL 问题
how to using sql generate sql statements?请教个数据管理的问题
相关话题的讨论汇总
话题: pk话题: table话题: fk话题: database话题: design