InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

InstantDB: Problem with updates and foreign keys (Beta 2)


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.