Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error when adding Foreign Key

519674Jun 23 2006 — edited Nov 16 2007
Hi,
Problem:
When trying to add a Foreign Key via Edit Table | Foreign Key tab an error is thrown

Error:
"ORA-00942: table or view does not exit", Vendor code 942

SQL Developer Generated DDL:
ALTER TABLE "CNArticlesCODES"
DROP CONSTRAINT "CNArticlesCODES_FK1"
;

ALTER TABLE "CNArticlesCODES"
ADD CONSTRAINT "CNArticlesCODES_FK1" FOREIGN KEY
(
"ID"
) REFERENCES CNArticlesDATA
(
"ID"
) ENABLE
;

My work around:
table name next to REFERENCES command in double quotes

ALTER TABLE "CNArticlesCODES"
ADD CONSTRAINT "CNArticlesCODES_FK1" FOREIGN KEY
(
"UID"
) REFERENCES "CNArticlesCODES"
(
"UID"
) ENABLE
;

SQL Developer 1.0.0.15.57 on Windows XP SP2

Oracle Database 10g Enterprise Edition Release 10.2.0.10 (Eval Lic) on Windows 2003 Web Edition 32 bit

The 2 tables in this example where generated by MS DTS tool while importing data. This issue is not present when performing the above action on 2 tables generated using SQL Developer.

I'm no database expert and new to Oracle (R&D stage of SQL Server to Oracle migration). So can some body tell me/point me at docs that explains what's going on here with the table names.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 14 2007
Added on Jun 23 2006
10 comments
3,587 views