var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: "ON DELETE CASCADE" fails in constraint clause
I have a table named Customers with the field CustID as primary key.
I then issued this DDL query to create another table - Orders:
CREATE TABLE Orders (OrderId INTEGER, CustId INTEGER, Qty Integer, CONSTRAINT FKOrdersCustId FOREIGN KEY (CustId) REFERENCES Customers ON DELETE CASCADE
When I execute the query a "Syntax error in CONSTRAINT clause" is returned and when i click ok, the DELETE clause is highlighted.
I am using MS-Access 2007.
The same error is trigered when I use the On UPDATE clause. The UPDATE clause is highlighted.
Many thanks everybody with help on this.
... references customers (<referencing field>) ON ...
I beleive you mean explicitly including the <referencing field> as in
"CREATE TABLE Orders (OrderId INTEGER, CustId INTEGER, OrderNotes varCHAR (255), CONSTRAINT FKOrdersCustId FOREIGN KEY (CustId) REFERENCES Customers (CustID) ON DELETE CASCADE)"
I did that and have done it again and the system still is flagging the DELETE clause.