오라클 테이블 정보 가져오기

select * –테이블정보
from all_tables
where tablE_name = ‘TB_M30_PRD_RSL’
;

select * — 컬럼정보
from all_tab_columns
where tablE_name = ‘TB_M30_PRD_RSL’
;

select * — 컬럼코멘트
from all_COL_COMMENTS
where tablE_name = ‘TB_M30_PRD_RSL’
;

select * — 테이블코멘트
from all_TAB_COMMENTS
where tablE_name = ‘TB_M30_PRD_RSL’
;

SELECT *
FROM all_constraints cons
WHERE CONSTRAINT_TYPE = ‘P’
;

SELECT — 테이블의 PK컬럼
cols.table_name, cols.column_name, cols.position, cons.status, cons.owner
FROM all_constraints cons, all_cons_columns cols
WHERE cons.constraint_type = ‘P’
AND cons.constraint_name = cols.constraint_name
AND CONS.TABLE_NAME = ‘TB_M30_PRD_RSL’
ORDER BY cols.table_name, cols.position
;

Leave a Reply

Your email address will not be published. Required fields are marked *