Subject RE: [firebird-support] Insert without referential constraints
Author Helen Borrie
At 01:54 PM 16/03/2004 +1300, you wrote:
>Without "deferred constraints" there is not much other way around it
>I came in a bit late on the tread... Unless you are talking about large data
>dumps rather than day to day live operation, then removing and re-adding FK
>constraints would seem a huge performance hit... Not to mention the "object
>in use" hassles...
>The Data Definition Guide talks about working with circular referential
>integrity (page 103 in my version) and states the workaround as suggested
>with the Nulls... Though it goes on about "Use ALTER TABLE to modify the
>EMPLOYEE table. Change the DEPT_NO column from NULL to '2'" it its example,
>which would tend to confuse!

For large batches, I would much prefer to load the rows for the primary
table first, commit them; then load the foreign table rows. That way, any
"orphans" will be discovered at source and can be logged as problem data
needing human attention.