Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Display CLOB content on AL32UTF8
10gR2/Solaris
With the code below I load a (xml) file to CLOB
File = 1521 bytes
But "dbms_lob.getlength(l_xmlclob)" returns half of that : 760
So when I try to read the CLOB out, the output is "?????????????????????"
Database NLS_CHARACTERSET = AL32UTF8
So DB character set is double-byte
What can one do to make the output readable (in western ascii) ?
thanks
DECLARE
l_xmlclob CLOB := EMPTY_CLOB; l_bfile bfile; l_length number ; l_amt number default 0; l_loc NUMBER := 0; l_anc NUMBER := 1; l_offset number default 1; l_text VARCHAR2(300) ;
dbms_lob.fileopen(l_bfile); dbms_lob.loadfromfile(l_xmlclob,l_bfile,dbms_lob.getlength(l_bfile)); dbms_lob.fileclose(l_bfile);
l_loc := dbms_lob.instr(l_xmlclob, chr(10), l_anc); l_text := dbms_lob.substr(l_xmlclob, l_loc - l_anc, l_anc); l_anc := l_loc + 1;