unicron
29th December 2003, 12:59
Hi
Is there a baan session that scans the database and reports tables with records that have invalid references?

eg.: an orderline with no orderheader.

This is normally not possible in a database, but there are some imports done with the option "no referential integrity check" :mad:

I tried session ttaad4225m000 and the option "file for undefined references" but this gave no result. And I know there are invalid records.

Any help would be greatly appriciated.

tia

Dikkie Dik
30th December 2003, 10:20
The session you mentioned is to check tables that have reference counters to other tables. More and more the check is not done by reference counters but by lookup. Seems that Baan has a gap in its functionality here.

Kind regards,
Dick

unicron
30th December 2003, 13:57
Than I have to do all the checks by hand, this is not nice :(

Is there maybe an external tool who can do this? Afterall all the data is in baan :
going over all the table definitions and do a select count statement for each related table. It is not that difficult to do,
so I hope somebody has done this before me ;)

thanks for the reply though

OmeLuuk
31st December 2003, 11:19
unicron: ... there are some imports done with the option "no referential integrity check" :mad: ...You know what tables are imported. Now most of the imported records would have references, otherwise it would make no sense to import them.

What you can do is: create a SQL query that prints all records of the imported tables and print them. I assume that when you print all fields of the table in a report and the reference is mandatory, you will hit an error 606 when the reference does not exist.

If you find that this is going well, you may also (in the report) read additional data from the referenced table (like desc fields) to be sure the reference does exist.

And the most straightforward way: redo the import now with referential check and have illegal records written to a file, filter them out of your database later.