I want to get all selected columns from a single select statement without executing execution. A query can use a join or a join, then a query can consist of more than just one table, so I canβt just use a statement
select column_name, data_type from user_tab_cols where table_name = 'my_table_name'
to get the result.
for instance
input:
select db1.* from (select dept_code, vital_signs, units, log_time from table1 where dept_code = '111' union select 'hl06' as dept_code, vital_signs, units, log_time from table2 where isdefault = 1 and vital_signs not in (select vital_signs from Ward_Vs_Vital_Signs where dept_code = '111')) db1, table3 db2 where db1.vital_signs = db2.vital_signs(+) order by db2.serial_no
exit:
column_name | data_type ------------------------- dept_code | VARCHAR vital_signs | NUMBER units | VARCHAR log_time | DATE
My question is: how can I parse the query and ask the database to tell me the columns and data types that will be returned without executing the statement? Thanks!
PS: I am using Oracle 10g.
source share