Oops. Does sound like a syntax problem. I'll look into it.
Regards
Pete
--
Peter Hearty peter.hearty@lutris.com
Lutris Technologies (UK) http://www.lutris.com
----- Original Message -----
From: "James Medlock" <jmedlock@tenornetworks.com>
To: <instantdb@enhydra.org>
Sent: Tuesday, September 19, 2000 4:23 PM
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: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
>
>
>
>
-----------------------------------------------------------------------------
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.
|