Oracle] Table and Column Comments extract query
Computer_IT/DBMS2018. 8. 8. 14:42
반응형
-- 테이블 COMMENT 조회
SELECT TABLE_NAME, TABLE_TYPE, COMMENTS
FROM USER_TAB_COMMENTS
WHERE COMMENTS IS NOT NULL;
-- 컬럼별 COMMENT 조회
SELECT *
FROM USER_COL_COMMENTS
WHERE COMMENTS IS NOT NULL;
-- 테이블별 COMMENT 쿼리문
SELECT 'COMMENT ON TABLE ' || TABLE_NAME || ' IS ''' || COMMENTS || ''';'
FROM USER_TAB_COMMENTS
WHERE COMMENTS IS NOT NULL;
COMMENT ON TABLE TABLE_NAME IS 'COMMENTS text';
-- 컬럼별 COMMENT 쿼리문
SELECT 'COMMENT ON COLUMN ' || TABLE_NAME || '.' || COLUMN_NAME || ' IS ''' || COMMENTS || ''';'
FROM USER_COL_COMMENTS
WHERE COMMENTS IS NOT NULL;
COMMENT ON COLUMN TABLE_NAME.COLUMN_NAME IS 'COMMENTS';
반응형
'Computer_IT > DBMS' 카테고리의 다른 글
[PostgreSQL] Function 내용 수정 (0) | 2019.05.17 |
---|---|
Oracle 테이블에서 날짜형식의 테이블만 추출하는 정규표현식 (0) | 2018.08.08 |
사용하기 쉬운 쿼리툴 _ DbVisualizer 장단점 (0) | 2015.06.17 |
h2 database utc time select (0) | 2013.05.21 |
DB2 - SNAPSHOT (0) | 2010.10.29 |