Hi,
In the old sql script we had a validation ( just check if there
is any invalid object in the database ), and after the validation if
there is any invalid object we were printing the result with the
ones that are invalid. This was really useful when you are running
the script.
I partially fixed the problem using a precondition, and if there
is any invalid object i just finish the execution of the script and
i print the error message. But I would like to list the invalid
objects also. Any Idea or suggestion ??
Current code:
-
<!-- Check invalid objects in the Data Base --><changeSet id="DataBaseCheck" author="e-ballo" runAlways="true" ><preConditions onFailMessage="There are invalid objects in the database!!"onFail="HALT" ><sqlCheck expectedResult="0"><![CDATA[SELECT count(1)FROM all_objects aloWHERE status = 'INVALID'AND alo.owner in('CIN','NOPA','ORC','PRV','SEC','TIPI_OWNER','TT','ZON');]]></sqlCheck></preConditions><sql><![CDATA[SELECT alo.owner, alo.object_name, alo.status, alo.last_ddl_timeFROM all_objects aloWHERE status = 'INVALID'AND alo.owner in('CIN','NOPA','ORC','PRV','SEC','TIPI_OWNER','TT','ZON');]]></sql></changeSet>
Thanks in advance