Mimicking Oracle's DEFINE statement using the data dictionary
by
antonh
—
last modified
07-Sep-06 11:48 AM
You can't put DESCRIBE TABLE in a ZSQL method without getting an ORA-00900 (invalid SQL) error, so I had to work out how to roll my own, using the Data Dictionary Tables.
This is the end result:
select column_name, data_type, data_precision, data_scale,
(select comments from dba_col_comments where table_name =
UPPER('subject') and owner = UPPER('tracer') and
column_name = dba_tab_columns.column_name)
from dba_tab_columns
where table_name = UPPER('subject')
and owner = UPPER('tracer')