Page 1 of 1

Integrity constraint violation: no parent SYS_FK_xxx

PostPosted: Tue Sep 05, 2017 3:05 pm
by AngleWyrm
Hiya, first post. I have some understanding of relational databases and Normal Forms, so fairly competent. I've been trying unsuccessfully to assemble a database structure for use as information storage so that I can formulate SQL questions about my currently favorite video game, Starbound. My stellar cartography catalog presently looks like so:


The troubles rear their ugly head when I go to insert record into the orbits table. There are only three required fields (the two defining the compound primary key, plus one data element) but attempts at storing that data result in an integrity constraint violation:


The constraint SYS_FK_77 doesn't seem to be visible to me from any of the menus, so I'm not clear on what is specified beyond 'system foreign key,' and don't seem to have the ability to rename it to something that conveys details of the relationship.

My first guess is that it's attempting an INSERT (Orbit, Planet, Star) into a table that has an arrangement (Star, Orbit, Planet), but as mentioned above, I haven't found a way to examine the SYS_FK_77 constraint.

Is there a way to look at the constraints automatically generated by the system?
Is there a better approach to dealing with the stated 'no parent SYS_FK_77' error?

Re: Integrity constraint violation: no parent SYS_FK_xxx

PostPosted: Tue Sep 05, 2017 3:28 pm
by Villeroy
1. Assuming that you are running an embedded HSQLDB, you can extract the database/script from the odb file which is a zip actualy.

2. Tools>SQL...
Code: Select all   Expand viewCollapse view
SCRIPT '/tmp/dbscript.sql'
dumps the DDL script to the specified directory.

3. In the GUI there is an index designer availlable when you open a table in edit mode and call menu:Tools>Index Design.