Greetings EE Gods...
I am in need of some SQL help:
I have a list of indicator columns spread throughout 47 tables...
I can find them using the below select statement:
select 'select distinct ' || COLUMN_NAME || ' from ' || TABLE_NAME ||';' from ALL_TAB_COLUMNS where COLUMN_NAME ='ATCHMNT_IND' and OWNER = 'AABASE';
now, this gives me a recordset output that gives me a list of select queries to run.
What I need is to have them all run consecutively where a single output recordset can be achieved without adding tables to the schema.
Here's the output I'm looking for:
TABLE_NAME COLUMN_NAME VALUE
TABLE1 IND1 YES
TABLE1 IND1 No
TABLE1 IND1 3
TABLE1 IND2 J
TABLE1 IND2 No
TABLE2 IND1 12