select a.COLUMN_NAME, '\t'), nvl(decode(A.NULLABLE,'N', 'NO', 'YES'), a.DATA_TYPE||'('||DECODE(a.DATA_TYPE,'NUMBER',a.DATA_PRECISION, a.DATA_LENGTH)||')', b.COMMENTS, from USER_TAB_COLUMNS a, USER_COL_COMMENTS b where a.TABLE_NAME = 'TEST' and a.TABLE_NAME = b.TABLE_NAME and a.COLUMN_NAME = b.COLUMN_NAME ORDER BY a.TABLE_NAME, COLUMN_ID
oracle table script
SELECT DBMS_METADATA.GET_DDL('TABLE',TABLE_NAME,OWNER) DBMS_METADATA.GET_DEPENDENT_DDL('INDEX',TABLE_NAME,OWNER), DBMS_METADATA.GET_DEPENDENT_DDL('COMMENT',TABLE_NAME,OWNER) FROM DBA_TABLES WHERE OWNER = 'OWNER' AND TABLE_NAME = 'TEST'
perl로 스트립트를 만드는데 table script는 lob관련 에러가 났다.
oracle connect 후에 추가한다.
$dbh->{LongReadLen} = 512 * 1024; $dbh->{LongTruncOk} = 1;
그리고 Wide character in print 관련 warnning은
binmode STDOUT, ':utf8';를 추가하면된다.
댓글 없음:
댓글 쓰기