oracle 10g get all selected columns and datatype from a single select
statement
I want to get all select columns from a single select statement .
For example
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
output:
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'm using Oracle 10g .
No comments:
Post a Comment