How to query a CLOB column in Oracle

前端 未结 8 1469
鱼传尺愫
鱼传尺愫 2020-11-27 06:24

I\'m trying to run a query that has a few columns that are a CLOB datatype. If i run the query like normal, all of those fields just have (CLOB) as the value.

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 06:47

    I did run into another condition with HugeClob in my Oracle database. The dbms_lob.substr only allowed a value of 4000 in the function, ex:

    dbms_lob.substr(column,4000,1)
    

    so for my HughClob which was larger, I had to use two calls in select:

    select dbms_lob.substr(column,4000,1) part1, 
           dbms_lob.substr(column,4000,4001) part2 from .....
    

    I was calling from a Java app so I simply concatenated part1 and part2 and sent as a email.

提交回复
热议问题