首页 > 数据库 >查询oracle的列信息与字符集

查询oracle的列信息与字符集

时间:2023-03-07 22:57:00浏览次数:40  
标签:name cc 字符集 NUMBER 查询 oracle DATA tc select

查询字符集与比较排序规则:

select userenv('language') from dual;
select parameter,value from nls_database_parameters where parameter in('NLS_CHARACTERSET','NLS_COMP','NLS_SORT');

 

查询列名,类型,是否可空,注释,默认值:
select tc.column_name,
decode(tc.data_type,
'NUMBER',
NVL2(DATA_PRECISION,
'NUMBER(' || tc.DATA_PRECISION || ',' || tc.DATA_SCALE || ')',
'NUMBER'),
'VARCHAR2',
'VARCHAR2(' || tc.DATA_LENGTH || ')',
'CHAR',
'CHAR(' || tc.DATA_LENGTH || ')',
'RAW',
'RAW(' || tc.DATA_LENGTH || ')',
tc.DATA_TYPE) as column_type,
NULLABLE,
cc.comments,
DATA_DEFAULT
from dba_tab_columns tc
join dba_col_comments cc
on tc.OWNER = cc.owner
and tc.TABLE_NAME = cc.table_name
and tc.COLUMN_NAME = cc.column_name
WHERE tc.owner = 'SCOTT'
and tc.table_name = 'TTTTT'
order by tc.COLUMN_ID;

 

标签:name,cc,字符集,NUMBER,查询,oracle,DATA,tc,select
From: https://www.cnblogs.com/JennyYu/p/17190052.html

相关文章