CONVERTTOCLOB procedure
595448Sep 8 2008 — edited Sep 8 2008I'm new to using this procedure.
There is a ConvertToClob procedure in Oracle that I want to use.
I have a BLOB named BLOB_CONTENT already being inserted into my database table named "xmltest2" I want to be able to either
1) Extract the Blob_content out of the table and convert it into a clob -OR-
2) Have the blob convert over to clob before inserting into the table.
Either is fine as long as it converts. lol
I have this so far.
___________________
Begin
-- this portion works just fine to add the BLOB into my database.
insert into xmltest2 (ID,ITEM_ID,TYPE,ENTERED_DATE,ENTERED_BY,VALIDATED,VALIDATED_DATE,VALIDATED_BY,
FILENAME, blob_content, clob_content)
select item_xml_seq.nextval,gda_item_id, v_xml_type, v_entered_date, v_entered_by,
v_validated, v_validated_date, v_validated_by, name, blob_content, clob_content
from gda_files@apex_gda_dev
where gda_item_id = v_item_id and name = v_file_name_xml;
---Here is where I think I am having issues. I have also put update SQL command at the end but it doesnt change anything.
DBMS_LOB.CREATETEMPORARY(lob_loc=>src_blob, cache=>TRUE, dur=>dbms_lob.SESSION);
DBMS_LOB.CREATETEMPORARY(lob_loc=>dest_lob, cache=>TRUE, dur=>dbms_lob.SESSION);
DBMS_LOB.CONVERTTOCLOB(dest_lob,src_blob,amount,dest_offset,src_offset,blob_csid,lang_context,warning);
Ive seen small bits of information on using a loop but thats probably over doing what I need. I just need the Blob to convert to clob and insert it into the table. Does anyone have any suggestions?
Thank you for any help. :))