>>I think you're missing
TABLE_TYPE = 'BASE TABLE' WHERE condition
>
>What would be a corrected version, in such a case, of the code?
If you don't have VIEWs in the DB than you don't have to do anything. Otherwise you should add the condition to both selects.
--sb--