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!

UTL_FILE.PUT_LINE and Spanish Characters

user639080May 29 2008 — edited May 29 2008
Hello All,

I'm writing a procedure which outputs data from a select statement to a txt file using UTL_FILE.PUT_LINE. No big deal... but here's my problem:

Some records contain data with Spanish characters in them, ie.: 'ñ'

When I look at the txt file, instead of having a 'ñ' in there, I get: 'ñ'

I also tried using UTL_FILE.PUT_NCHAR (and UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN) because I thought it might have to do with that being a multi-byte character, and I still get the same result.. To test it out I'm just using this small piece of code:

PROCEDURE test_proc
AS
fileid UTL_FILE.file_type;
v_filename VARCHAR2 (60);
v_rec_proc INTEGER := 0;
v_intname VARCHAR2 (30);
v_status NUMBER := 0;
v_msg VARCHAR2 (255);
v_test VARCHAR2 (3271) := 'X';
done TIMESTAMP ( 6 );


BEGIN
v_filename :=
'test_file.txt';

fileid :=
UTL_FILE.fopen_nchar ('DIR', 'test_file.txt', 'W', 32760);
--utl_file.put_line(fileid, char('ñ c');

utl_file.put_nchar(fileid, char('ñ'));
UTL_FILE.fclose (fileid);
END test_proc;



Anyone know how I can remedy this problem and get the procedure to output 'ñ' to the txt file.

Thanks in advance,
Tommy
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 26 2008
Added on May 29 2008
1 comment
953 views