in Oracle, how can i read a large blob as a text document
I have a BLOB which actually contains text from a few hundreds chars to
20K+ chars. I am given this (I know it should be a CLOB, but not my
choice). I need to be able to get the entire text document. The closest
I've come is this:
select utl_raw.cast_to_varchar2(dbms_lob.substr(blob_data,2000,1)) from
my_table where id = 'id_value'; --get up to 2000
I can't get past 2000 at a time, though I guess I can get the size (using
dbms_lob.getlength) and get 2000 at a time and put it together. Seems like
there should be a better answer. Does anyone have a better way?
No comments:
Post a Comment