Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Whats wrong with this code

Author  Topic 

Thechewinggummonster
Starting Member

8 Posts

Posted - 2014-01-26 : 11:22:31
I have a table called customer with cust_id as the primary key.
I have a table called quote which I'm trying to link to customer, with this code:

ALTER TABLE Quote ADD CONSTRAINT fk1_Quote_to_Customer FOREIGN KEY(fk1_Cust_Id) REFERENCES Customer(Cust_Id) ON DELETE RESTRICT ON UPDATE RESTRICT

But get this error on Oracle
ORA-00905: missing keyword

and on W3Cschools.com: syntax error near "CONSTRAINT"

Thechewinggummonster
Starting Member

8 Posts

Posted - 2014-01-26 : 11:50:54
OK found the problem, something to do with the "ON DELETE RESTRICT ON UPDATE RESTRICT" part of the command. Does anyone know what it does?
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-01-26 : 18:54:51
No idea. Try posting at a Oracle forum. This site is on Microsoft SQL Server


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -