-
I am having some trouble. I want to cascade on delete and update, but I keep getting an error. Anyone know what I am doing wrong?
CREATE TABLE t3 (
a,
b,
CONSTRAINT fk_a FOREIGN KEY (a)
REFERENCES t1 (a) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT fk_b FOREIGN KEY (b)
REFERENCES t2 (b) ON DELETE CASCADE ON UPDATE CASCADE
);
-
there are some anamolies in your Create syntax
1) u must specify the column datatypes
2)i am not very sure wheather on update cascade is valid or not , but datatypes of all columns specufied is mandatory
Aniruddha Gupta
-
always
Note:
Always create your tables with NO constraints, and then ADD constraints after table creation. This will help you debug constraint errors much more easily.
- Magnus
-
i thought that the references clause makes it inherit the data properties?
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|