select
own.name owner,
obj.name obj_name,
col.name col_name,
case col.type#
when 1 then 'varchar2'
when 32 then 'raw or nvarchar2?'
else to_char(col.type#)
end data_type, -- ?
col.length,
col.precision#,
col.scale,
col.null$,
col.deflength,
col.default$,
--
-- Convert LONG to CLOB.
--
-- sys.dbms_metadata_util.long2clob(32000, 'SYS.COL$', 'DEFAULT$', col.rowid) default_as_clob,
--
-- Commented because call might throw:
-- - ORA-00904: "SYS"."DBMS_METADATA_UTIL"."LONG2CLOB": invalid identifier or
-- - ORA-01031: insufficient privileges
-- --------------------------------
col.intcol#, -- Internal column number
col.property,
case when bitand(col.property, 1) > 0 then 'adt' end adt,
case when bitand(col.property, 16) > 0 then '16' end "16",
case when bitand(col.property, 32) > 0 then 'invisible' end invisible, -- aka hidden
case when bitand(col.property, 1024) > 0 then 'ntab' end nested_table,
case when bitand(col.property, 32768) > 0 then 'unused' end unused ,
case when bitand(col.property, 8796093022208) > 0 then 'sensitive' end sensitive, -- KQLDCOP2_SEN
case when bitand(col.property, 18889465931478580854784) > 0 then 'perfor' end perfor, -- KQLDCOP3_PERFOR (See comment in e21.sql)
col.charsetid,
col.charsetform,
col.evaledition#,
col.unusablebefore#,
col.unusablebeginning#,
col.acdrrescol#,
col.collid,
col.collintcol#,
col.fixedstorage,
col.spare1, col.spare2, col.spare3, col.spare4, col.spare5, col.spare6, col.spare7, col.spare8, col.spare9, col.spare10, col.spare11, col.spare12, col.spare13
from
sys.obj$ obj join
sys.user$ own on obj.owner# = own.user# join
sys.col$ col on obj.obj# = col.obj#