Home » SQL & PL/SQL » SQL & PL/SQL » ConvertToClob does not work
icon13.gif  ConvertToClob does not work [message #216768] Tue, 30 January 2007 05:37
Proficianado
Messages: 1
Registered: April 2006
Junior Member
Dear All,

I tried to convert a blob to clob using the DBMS_LOB.convertToClob function. The conversion works as in oracle does not complain. But when I try to read the clob, I still see the binary data and not text.

The blob was created using charset UTF-16 but our DB NLS_CHARACTERSET parameter is WE8ISO8859P1.

The function I used is as below:

create or replace function myblobtoclob(blob_in IN BLOB)
return clob  is

v_file_clob clob;
v_file_size integer := dbms_lob.lobmaxsize;
v_dest_offset integer := 1;
v_src_offset integer := 1;
v_blob_csid number := dbms_lob.default_csid;
v_lang_context number := dbms_lob.default_lang_ctx;
v_warning integer;

begin

DBMS_LOB.CREATETEMPORARY(v_file_clob, TRUE);

dbms_lob.convertToClob(v_file_clob,
                       blob_in,
                       v_file_size,
                       v_dest_offset,
                       v_src_offset,
                       v_blob_csid,
                       v_lang_context,
                       v_warning);

return v_file_clob;
exception
      WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE ('Error found');
end;

I have been breaking my head over this for a few days now. Please help.

Thanks in advance.

Profi

[Updated on: Thu, 01 February 2007 06:28] by Moderator

Report message to a moderator

Previous Topic: get duplicate record in a table
Next Topic: sql help
Goto Forum:
  


Current Time: Sat Dec 10 05:02:59 CST 2016

Total time taken to generate the page: 0.06554 seconds