Hi Gurus,
I am trying to come up with one requirement to generate sql statements dynamically , and run each statement individually.Before running any job, we load multiple tables from one procedure.Now I have a requirement to check if all dependency tables for that package is loaded for a given day or not.If we don't have data then throw error.
I am using all_dependencies to pull dependent tables I can get the list of queries however what would be efficient way to execute each statement? Is there a way to process each statements using some cursor?
SELECT 'SELECT COUNT(*) FROM '||REFERENCED_NAME ||' WHERE CREATED_DATE = SYSDATE;' FROM ALL_DEPENDENCIES
WHERE OWNER=SCHEMA_1
AND NAME = MY_PKG
AND REFERENCED_TYPE='TABLE';
Thanks