[ORACLE]CLOB DATA Export Excel(DBMS_LOB.SUBSTR)

Database 2016.03.28 15:09 Posted by 애플자라

CLOB 데이터가 원하는데로 안나와서 일단 미련하게 추출; 


 SELECT 

   BOARD_SEQ,

         SEQ,

         TITLE,

         DBMS_LOB.SUBSTR(CNTNT, 2000, 1)  AS CONTENTS1,

         DBMS_LOB.SUBSTR(CNTNT, 2000, 2001)     AS CONTENTS2,

         DBMS_LOB.SUBSTR(CNTNT, 2000, 4001)     AS CONTENTS3,

         DBMS_LOB.SUBSTR(CNTNT, 2000, 6001)     AS CONTENTS4,

         DBMS_LOB.SUBSTR(CNTNT, 2000, 8001)     AS CONTENTS5,

         DBMS_LOB.SUBSTR(CNTNT, 2000, 10001)    AS CONTENTS6,

         DBMS_LOB.SUBSTR(CNTNT, 2000, 12001)    AS CONTENTS7,

         DBMS_LOB.SUBSTR(CNTNT, 2000, 14001)    AS CONTENTS8,

         DBMS_LOB.SUBSTR(CNTNT, 2000, 16001)    AS CONTENTS9

         --dbms_lob.getlength(CNTNT) -- 15801

    FROM TBD_BOARD

   WHERE BOARD_SEQ = '3'

ORDER BY SEQ DESC

댓글을 달아 주세요