zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

Oracle获取表字段名,字段类型,字段长度,注释

Oracle 获取 类型 注释 字段名 段长度
2023-09-27 14:21:58 时间
SELECT b.comments as 注释,
       a.column_name as 列名,
       a.data_type || '(' || a.data_length || ')' as 数据类型,
       a.nullable as 是否为空
  FROM user_tab_columns a, user_col_comments b
 WHERE a.TABLE_NAME = '表名'
   and b.table_name = '表名'
   and a.column_name = b.column_name