您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Oracle用SQL语句实现desc函数功能

2026/1/1 14:42:14发布35次查看
oracle用sql语句实现desc函数功能: select a.column_name 字段名, data_type ||decode(data_type,
oracle用sql语句实现desc函数功能
[日期:2012-05-18]来源:linux社区 作者:linux[字体:]
oracle用sql语句实现desc函数功能:
select a.column_name 字段名,
        data_type ||decode(data_type,'date','','clob','','blob','','bfile','','float','','long raw','','long','','raw','(' || to_char(data_length) || ')',
               (decode(sign(instr(data_type, 'char')),1,
                 '(' || to_char(data_length) || ')',(decode(substr(data_type, 1, 9),
                  'timestamp', '',
                 (decode(nvl(data_precision, -1), -1,
                  '',(decode(nvl(data_scale, 0), 0,
                  '(' || to_char(data_precision) || ')', '(' || to_char(data_precision) || ',' ||
                 to_char(data_scale) || ')'))))))))) 字段类型,
        a.nullable 允许为空,
        a.data_default 默认值,
        b.comments 字段注释
   from all_tab_columns a,
        all_col_comments b
  where b.table_name=a.table_name
  and a.owner=b.owner
  and a.column_name=b.column_name
  and a.table_name =upper( 'table_name')
    and a.owner =upper( 'user')
  order by column_id;
更多oracle相关信息见oracle 专题页面 ?tid=12

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product