+ 2
Foreign Key Constraint with ON DELETE CASCADE ON UPDATE CASCADE
I am creating the SQL table below: Create TABLE lawyer (Lyr_lf_name varchar2(45), Lyr_name varchar2(30) Constraint pk_lyr Primary Key, Lyr_emp# varchar2(11) Constraint nn_emp# Not Null Constraint unq_emp Unique, Lyr_qual varchar2(37) Constraint nn_qual Not Null, Lyr_exp smallint Constraint nn_exp Not Null, Constraint fk_lwf Foreign Key (lyr_lf_name) References law_firm (Lf_name) ON Delete Cascade ON UPDATE Cascade ); I want to find out why am I getting an error on “ON delete cascade on update cascade” portion. It is saying I am missing a right parentheses. I am just not sure where and why I would need to add a parentheses? I would appreciate any help thanks.
6 odpowiedzi
+ 1
I am a sql server user so I did not know that
Missing right parenthesis is a strange error. But it looks like there is no "update cascade"
I found this link when googling.
https://community.oracle.com/thread/829160
unfortunately the link with the solution is no longer found.
+ 2
thank you for the help
+ 1
Oracle 10g
+ 1
and yes it is allowed
+ 1
Cool glad you foundation it.
0
Which sql do you use ?
Is varchar2 a correct datatype ?
Constraint nn_emp# is it allowed to use #