Title:
I get an SQL syntax error when I use a foreign key table
contraint. Is this a known problem or am I doing something wrong?
create table BAR
( ID
int );
create table FOO
( ID
int, NAME
CHAR(32) ) foreign key (ID) references BAR(ID) on delete
cascade;
This causes the following
exception:
java.sql.SQLException: create table FOO ( ID
int, NAME char(32))foreign key (ID)
references BAR(ID) on delete cascade Don't understand SQL after:
"on" Expected: "null" found:
"on" at
java.lang.Throwable.fillInStackTrace(Native
Method) at
java.lang.Throwable.fillInStackTrace(Compiled
Code) at
java.lang.Throwable.<init>(Compiled
Code) at
java.lang.Exception.<init>(Exception.java:42)
at
java.sql.SQLException.<init>(SQLException.java:82)
at
org.enhydra.instantdb.db.SQLProg.execute(SQLProg.java:215)
at org.enhydra.instantdb.jdbc.idbStatement.execute(Compiled
Code) at
org.enhydra.instantdb.jdbc.idbStatement.executeUpdate(idbStatement.java:103)
at org.enhydra.instantdb.SampleThread.run(Compiled
Code) at
java.lang.Thread.run(Thread.java:479)
Either
removing the "on delete cascade" or attaching the constraint to the column does
work.
Thanks James
|