Home » SQL & PL/SQL » SQL & PL/SQL » CLOB wrong character
CLOB wrong character [message #193145] Fri, 15 September 2006 01:03
ehegagoka
Messages: 493
Registered: July 2005
Senior Member
hi!
why does the text inserted to CLOB changes character? like this:


SQL> declare
  2    l_clob clob;
  3    l_file bfile := bfilename('UTL_DIR', 'story.txt');
  4  begin
  5    select chapter_text
  6    into l_clob
  7    from my_book_text
  8    where chapter_desc = 'Chapter 1'
  9    for update of chapter_text;
 10  
 11    dbms_lob.fileopen(l_file);
 12  
 13    dbms_lob.loadfromfile(l_clob, l_file, 13);
 14    commit;
 15  
 16    dbms_lob.fileclose(l_file);
 17  end;
 18  /

PL/SQL procedure successfully completed

SQL> select chapter_text from my_book_text
  2  /

CHAPTER_TEXT
--------------------------------------------------------------------------------
żżżż4ż

SQL> set serveroutput on
SQL> 
SQL> declare
  2    l_clob clob;
  3  begin
  4    select chapter_text
  5    into l_clob
  6    from my_book_text
  7    where chapter_desc = 'Chapter 1';
  8  
  9    dbms_output.put_line(dbms_lob.substr(l_clob, 13, 1));
 10  end;
 11  /

żżżż4ż

PL/SQL procedure successfully completed

SQL> 



but the text file contains this string "A simple text". Thanks sir/mam



SOLVED!

http://www.idevelopment.info/data/Oracle/DBA_tips/LOBs/LOBS_40.shtml

[Updated on: Fri, 15 September 2006 04:59]

Report message to a moderator

Previous Topic: Can clarify pls
Next Topic: regarding bulk collect
Goto Forum:
  


Current Time: Tue Dec 10 02:02:27 CST 2024