更改表语句以强制实体完整性
我有以下 ORACLE 10g 的表,问题是我试图在所有表上强制实体完整性。我已经完成了前 4 个,但最后一个抛出了错误。我使用以下代码来更改表:
ALTER TABLE name ADD CONSTRAINT name PRIMARY KEY (name);
Actor (actorID, lastName, firstName, middleName, suffix, gender, birthDate, deathDate)
Movie (movieID, title, year, company, totalNoms, awardsWon, DVDPrice, discountPrice)
Quote (quoteID, quote)
Role (roleID ,roleName ,gender ,actorID* ,movieID*)
RoleQuote (roleID*, quoteID*)
对于我尝试过的最后一个表(RoleQuote),
ALTER TABLE name ADD CONSTRAINT name, name PRIMARY KEY (name, name);
但它抛出了此错误:
invalid identifier
任何人都可以帮助我,谢谢,表已创建,没有错误,并且它们工作完美,但最后一个表的约束表 (RoleQuote) 不起作用。
He guys I have the following the tables for ORACLE 10g and the problem is i am trying to enforce entity integrity on ALL tables. I have completed the first 4 but the last one is throwing an error. I have used the following code to alter the tables:
ALTER TABLE name ADD CONSTRAINT name PRIMARY KEY (name);
Actor (actorID, lastName, firstName, middleName, suffix, gender, birthDate, deathDate)
Movie (movieID, title, year, company, totalNoms, awardsWon, DVDPrice, discountPrice)
Quote (quoteID, quote)
Role (roleID ,roleName ,gender ,actorID* ,movieID*)
RoleQuote (roleID*, quoteID*)
for the last table (RoleQuote) i have tried
ALTER TABLE name ADD CONSTRAINT name, name PRIMARY KEY (name, name);
but it is throwing this error:
invalid identifier
Can anyone help me thanks the tables have been created without error and they work flawless but the constraint on the last table (RoleQuote)is not working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)