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 (
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
Always create your tables with NO constraints, and then ADD constraints after table creation. This will help you debug constraint errors much more easily.
i thought that the references clause makes it inherit the data properties?
Click Here to Expand Forum to Full Width