oracle 如何匯出資料字典

2022-01-30 14:25:29 字數 2138 閱讀 6991

-- 查詢某錶的資料字典

select  a.table_name as "表名",a.column_name as "欄位名",

decode(a.char_length,0,decode(a.data_scale,null,a.data_type,a.data_type||'('||a.data_precision||','||a.data_scale||')'),

a.data_type||'('||a.char_length||')') as "字段型別1",a.data_type as "字段型別",a.data_precision as "有效位",a.data_scale as "精度值",

a.char_length as "字段長度",a.nullable as "能否為空"

from sys.user_tab_columns a where a.table_name = 'tam_address'

--  具有dba許可權使用者匯出資料字典

select  a.table_name as "表名",a.column_name as "欄位名",

decode(a.char_length,0,decode(a.data_scale,null,a.data_type,a.data_type||'('||a.data_precision||','||a.data_scale||')'),

a.data_type||'('||a.char_length||')') as "字段型別",a.data_default as "預設值",

a.nullable as "能否為空",b.comments as "備註"

from sys.all_tab_columns a,sys.dba_col_comments b

where a.owner=b.owner and a.table_name=b.table_name  and a.column_name=b.column_name and a.owner='guoqiang'  and

a.table_name in (

'tb_subject', 'tb_subject_balance', 'tb_voucher', 'tb_voucher_details',

'tb_customer', 'tb_voucher_classify_mode', 'tb_voucher_type', 'tb_asset',

'tb_asset_catalog', 'tb_m_dm_assets_liabi_rpt', 'tb_m_dm_profit_rpt',

'tb_m_dm_revenue_rpt', 'tb_m_dm_cost_rpt'

)order by a.table_name

--一般使用者匯出該使用者下的資料字典

select  a.table_name as "表名",a.column_name as "欄位名",

decode(a.char_length,0,decode(a.data_scale,null,a.data_type,a.data_type||'('||a.data_precision||','||a.data_scale||')'),

a.data_type||'('||a.char_length||')') as "字段型別",a.data_default as "預設值",

a.nullable as "能否為空",b.comments as "備註"

from sys.user_tab_columns a,sys.user_col_comments b

where a.table_name=b.table_name  and a.column_name=b.column_name and

a.table_name in (

'tb_subject', 'tb_subject_balance', 'tb_voucher', 'tb_voucher_details',

'tb_customer', 'tb_voucher_classify_mode', 'tb_voucher_type', 'tb_asset',

'tb_asset_catalog', 'tb_m_dm_assets_liabi_rpt', 'tb_m_dm_profit_rpt',

'tb_m_dm_revenue_rpt', 'tb_m_dm_cost_rpt'

)order by a.table_name

oracle 如何匯出資料字典

查詢某錶的資料字典 select a.table name as 表名 a.column name as 欄位名 decode a.char length,0,decode a.data scale,null,a.data type,a.data type a.data precision a.da...

Oracle使用之 匯出資料字典

select from user tab comments where table name like web ply base select from dba tab comments where table name like web ply base select wm concat colu...

mysql 匯出資料字典

select table catalog,table schema as 資料庫名,table name as 表名,column name as 欄位名,ordinal position as 字段位置,column default as 字段預設值,is nullable 是否允許空值,data...