Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to write raw data using UTL_FILE in UTF-8 charector mode

user275751Mar 7 2012 — edited Mar 8 2012
Hello

I have a requirement to extract the data from Sales Order and write it in as a csv file. My extract contains some zunk charectors if data contains any special charectors like Japanees charectors.. To avoid this I am writing the data in to file by using the UTL_RAW.cast_to_raw conversion as below command...

UTL_FILE.PUT_RAW (file,
UTL_RAW.cast_to_raw (v_chr_line_record|| chr(10) ||chr(13)));

Above approach is fixing to get the special charectors but If I Open the csv file in excel then I am getting a extra free line between each line because I am using chr(10). If i remove this chr(10) and chr(13) then If i open the csv file in notepad then entire file contains zunk charectors.

Is what I am folliowing is the right approach to write the file in UTF-8 format to have the file with special charectors? If not, can you please help me how to write the data in csv file with UTF-8 format?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2012
Added on Mar 7 2012
5 comments
2,811 views