I remember reading somewhere that the recent version of InstantDB, supports
only the REFERENCES syntax of foreign key.
-Lalitha
> -----Original Message-----
> From: James Medlock [SMTP:jmedlock@tenornetworks.com]
> Sent: Tuesday, September 19, 2000 8:24 AM
> To: instantdb@enhydra.org
> Subject: InstantDB: Foreign Key syntax problem
>
> 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:10
> 3)
> 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
>
>
>
-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.
|