SAP IQ - 获取表及字段信息
-
tolywang
2017-10-11 16:22:12
-
数据挖掘
-
原创
select t.table_name,
c.column_name,
case
when c.user_type is null then
d.domain_name || case
when d.domain_name in ('numeric', 'decimal') then
'(' || c.width || ',' || c.scale || ')'
when d.domain_name in
('char', 'varchar', 'float', 'binary', 'varbinary') then
'(' || c.width || ')'
else
''
end
else
(select type_name
from SYS.SYSUSERTYPE ut
where ut.type_id = c.user_type)
end domain_name,t.table_type_str,c.table_id,c.column_id
from SYS.SYSTAB t, SYS.SYSUSER u, SYS.SYSTABCOL c, SYS.SYSDOMAIN d
where t.creator = u.user_id
and t.table_id = c.table_id
and c.domain_id = d.domain_id
-- and t.table_type_str =upper (p_tab_type)
and u.user_name = 'msgdw2'
order by c.table_id ,c.column_id;