Hi, I might be wrong, but I think you're trying to do this the hard way. The problem is really simple in that you have some missing data that is not loading correctly. To fix this issue I would suggest the following steps:
1- Copy the XML data file contents 2- Paste it into the XML data import window (i.e. https://localhost:8443/webtools/control/EntityImport) 3- Click Import Text 4- Observe error message (it will tell you which foreign key is violated and how) 5- fix the data accordingly 6- Repeat 1 to 5 as needed That would be much faster and easier than going down to the SQL level to try to investigate. I recommend that you use the entity engine to your advantage instead of bypassing it completely. HTH On Wed, Jun 7, 2017 at 1:42 AM, <stim...@comcast.net> wrote: > Hi, > > There are 861 tables in the ofbiz Derby database under ofbiz-16.11.02 for > demo data. I'm trying to learn to load this data manually using SQL > queries, and thus making a dependency list of tables with foreign key > requirements (or even references to other tables which are allowed to be > null). Basically, no table referencing another table's data can be loaded > without first loading that parent table. With 861 tables and some tables > having more than one foreign key I wanted to automate this with a SQL query > (I'm using SQuirrel-sqL to explore now). As such I'm looking at system > tables describing constraints and keys. > > Through system tables I can find a list of tables and the ID of > constraints which are foreign keys. However, I seem to be losing the battle > to find the name of the foreign table and foreign column name to which the > constraint points (only the table with the originating constraint is easy > to find and automate a listing for). I see this may be possible to find > through JDBC; SQuirrel-sqL itself shows imported and exported keys with no > apparent means to export the information. Can anyone tell me if it is > possible to use an ordinary SQL query to find all foreign keys of a table > and print the list of the child table and the parent foreign table.column? > If I can do this I can get around the missing WebPOS setup functionality > and edit/load SQL directly (I'm using PostegreSQL so I can't edit a Derby > database directly...it needs to be copied over to PostgresSQL first in the > proper order). > > If you think I need to write a JDBC app instead to map table load order > dependencies, please let me know. I don't believe there is any other way to > use the WebPOS without doing it this way. I hate to think I may have to go > through all of those tables and hand write a spreadsheet with the > dependencies. > > Thanks!