Recurring data loading problems

From: Sandy Pittendrigh <sandy_at_nervana.montana.edu>
Date: Fri, 23 Apr 1999 09:10:07 -0600
Message-ID: <37208D4F.3A849619_at_nervana.montana.edu>



DATA-LOADING PROBLEMS: 1)
How do you (does the programmer) get data into an empty table structure? One way is to start at the top of the table hierarchy, and add data in a sequence specific way, so subsequent additions to referring tables don't encounter "foreign key not found" errors-- as the data is loaded.

2)
But how do you provide for convenient, interactive script or GUI screen inserts to an already loaded schema?
The programmer can write code for inserts (into "leaf-node tables") that start with a series of hard coded selects, that traverse up thru the table hierarchy to see if any pre-requisite foreign keys are missing, (before trying to make any leaf-node inserts). But this is a hard-coded, insert-by-insert, table-by-table solution.

It would be substantially slicker if there was a programatic, generic, run-time way to figure out these foreign key prerequisites...perhaps through some library of routines that knows how to examine the dbms data dictionary. If this is possible, than surely someone has already done it. But I can't find any code or textbooks that explain how to do this. Is this possible? Who can show me how to do it?

-- 
/* Sandy Pittendrigh                  >--oO0>

* sandy_at_nervana.montana.edu
* http://www.nervana.montana.edu/~sandy
*/
Received on Fri Apr 23 1999 - 17:10:07 CEST

Original text of this message