DDL Constraint Syntax

Bechert

Registered User.
Local time
Today, 15:00
Joined
Apr 11, 2003
Messages
59
Hi all, I am adding a table to a backend DB using DDL. I want to add referential integrity to the relationship between the new table (TblDocWHLower - the child) and an existing table (TblDocMain - the parent). When I execute the following code I receive a "syntax error on Constraint clause" message. When I execute without the "ON UPDATE CASCADE ON DELETE CASCADE", I don't receive the error.

StSQL = "CREATE TABLE TblDocWHLower (TableKey AUTOINCREMENT PRIMARY KEY, TblDocID LONG CONSTRAINT LowerTblDocIDIndex UNIQUE, CONSTRAINT LowerFK FOREIGN KEY (TblDocID) REFERENCES TblDocMain (TblDocID) ON UPDATE CASCADE ON DELETE CASCADE);"

DbBEDB.Execute StSQL

I have enabled SQL Server Compatibility Syntax (ANSI 92).

Thanks for your help.
Bill
 

Users who are viewing this thread

Back
Top Bottom