Hi!
If the DB schema is complex and/or is unfamiliar it can be difficult to
establish a proper load order. But it is solved by running set integrity many times.
I used this sql to generate a file of "set integrity" stmts
which_tables_need_set_integrity.sql:
Select
'set integrity for MYSCHEMA.'||A.TABNAME||' allow no access immediate checked;'
From SYSCAT.TABLES A
Where A.TABSCHEMA = 'MYSCHEMA'
and status ='C'
Order by A.TABNAME
;
#!/bin/sh
echo "connect to MYDB;" >set_integrity.sql
db2 -vtf which_tables_need_set_integrity.sql|grep -e ";"| grep -v TABNAME >>set_integrity.sql
echo "terminate;" >>set_integrity.sql
db2 -vtf set_integrity.sql
echo "When njumber of rows = 2, we are done"
wc -l set_integrity.sql
/dg