DS's『 행복합시다 』

Carpe Programming/oracle

vo 생성용 조회 쿼리

nolite 2011. 7. 26. 17:08


---------------------------
적당한 노가다가 좋아요. +_+
---------------------------



SELECT 'private ' || DECODE(DATA_TYPE,'DATE'    , 'String'
                                     ,'CHAR'    , 'String'
                                     ,'VARCHAR2', 'String'
                                     ,'NUMBER'  , 'int'
                                     ,DATA_TYPE)
                  || ' ' || LOWER(A.COLUMN_NAME) || ';'
                  || '                               // '
                  || B.COMMENTS
  FROM USER_TAB_COLUMNS A
     , USER_COL_COMMENTS B
 WHERE 1=1
   AND A.TABLE_NAME  = B.TABLE_NAME
   AND A.COLUMN_NAME = B.COLUMN_NAME
   AND A.TABLE_NAME  = 'NEW_QAJUDGE_RST';

728x90