When I try and do an update of a row in a table for which there is a foreign
key reference, I get an exception stating that "Cannot delete value, XXX. In
use by column A.B".
Am I doing something wrong, or can Foreign Keys not be used in tables that
are being updated?
Thanks
James
--
Example:
; First load the JDBC driver and open a database.
d org.enhydra.instantdb.jdbc.idbDriver;
o jdbc:idb=blah.prp;
; Record all results
e SET EXPORT "export0.txt" FIXEDLENGTH COLNAMEHEADER ROWNUMBERS CONTROLCOL
SUMMARYHEADER;
e create table BAR (
ID int,
NAME CHAR(32)
);
e create table FOO (
ID int foreign key references BAR(ID) on delete cascade,
NAME char(32)
);
e insert into BAR(ID, NAME) values(101, "fred");
e insert into BAR(ID, NAME) values(102, "joe");
e insert into FOO(ID, NAME) values(101, "fred2");
e insert into FOO(ID, NAME) values(102, "joe2");
; This fails with "Cannot delete..." exception
e update BAR set NAME="newfred" where ID=101;
; The End
c close;
-----------------------------------------------------------------------------
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.
|