UTL_FILE.PUT_LINE and Spanish Characters
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