Hello,
I am attempting to do the following:
1) Select distinct table names from all_tab_columns where column_name = 'ABC' and owner = 'XYZ'
SQL:
SELECT distinct table_name
INTO tables_ABC_XYZ
FROM all_tab_columns
WHERE column_name = 'ABC'
AND owner = 'XYZ';
2) Query the tables identified with the first query based on a specific criteria.
SQL:
SELECT count...
FROM schema."table_ABC_XYZ"
WHERE 'ABC' = 123
3) Identify those tables that have at least one record returned based on the specific criteria
...and if count > 0, then list the table name (table_ABC_XYZ)
I believe a procedure (PL/SQL) can help me accomplish this, but I'm struggling with it.
Thanks for your help!!!
I am attempting to do the following:
1) Select distinct table names from all_tab_columns where column_name = 'ABC' and owner = 'XYZ'
SQL:
SELECT distinct table_name
INTO tables_ABC_XYZ
FROM all_tab_columns
WHERE column_name = 'ABC'
AND owner = 'XYZ';
2) Query the tables identified with the first query based on a specific criteria.
SQL:
SELECT count...
FROM schema."table_ABC_XYZ"
WHERE 'ABC' = 123
3) Identify those tables that have at least one record returned based on the specific criteria
...and if count > 0, then list the table name (table_ABC_XYZ)
I believe a procedure (PL/SQL) can help me accomplish this, but I'm struggling with it.
Thanks for your help!!!