I make the changes in code and test on a copy of the database. Once I have the code working correctly, I run it on the target database. Of course, I always have a backup.
This method, while more tedious, is robust and pretty bullet proof. Dennis McGrath Software Developer QMI Security Solutions 1661 Glenlake Ave Itasca IL 60143 630-980-8461 [email protected] From: [email protected] [mailto:[email protected]] On Behalf Of Kenny Camp Sent: Wednesday, May 02, 2012 1:21 PM To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Constraint troubleshooting? I experienced this issue several times recently and in my case it was caused by altering a table. I'm having trouble figuring out why this is happening in order to demonstrate to others, but to avoid the problem, whenever I plan to alter tables I unload structure and data separately, then cut the structure file into two pieces. One to build all the tables and a second to add constraints (and the other stuff below the first create index statement). I build a new database and add the data, then alter my tables, then run the second part of the structure file. This seemed to have eliminated the problem for me. Kenny From: [email protected]<mailto:[email protected]> [mailto:[email protected]]<mailto:[mailto:[email protected]]> On Behalf Of [email protected]<mailto:[email protected]> Sent: Wednesday, May 02, 2012 11:47 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Constraint troubleshooting? We used "unload all" to recreate the database for a recent upgrade from 7.6 to 9.1 64-bit. An autochk on the database gives us 6 instances of an error "A foreign key references a table not known to be referenced" on various tables. First I used some existing code I had to create a cursor thru all FK columns and write out what PK column/table it references per the sys_indexes table, and also displayed the "referenced" flag of that PK. Everything looks great. So then I did an "unload schema" and looked at the bottom at all the FKs (luckily only 25 of them) and all of them reference good tables & columns. If I list each PK table, each one shows "PK referenced". Anyone have a clue what that message means and how I can find out what the offending entries are? If we reload the database, the reloaded copy shows the same errors. Karen

