How to query a CLOB column in Oracle

Catfish picture Catfish · Sep 24, 2010 · Viewed 429.8k times · Source

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.

I tried using DBMS_LOB.substr(column) and i get the error

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

How can i query the CLOB column?

Answer

Chris picture Chris · Nov 17, 2010

This works

select DBMS_LOB.substr(myColumn, 3000) from myTable