Character Set question in sql*plus
Hi,
I have a bash script that executes sql scripts from directory like this:
sqlplus / <<EOF
whenever sqlerror exit sql.sqlcode
spool $DIR_SPOOL/output
`for script_file in $(ls $DIR_SQL)
do
echo @$DIR_SQL/$script_file
done
`
spool off
EOF
The database character set is AL32UTF8 and linux server uses locale UTF-8. LNS_LANG is AL32UTF8.
The problem is the file encoding of sql scripts from $DIR_SQL. They are developed in WINDOWS-1252 encoding.
The first solution I found was set NLS_LANG to WE8MSWIN1252. The problem is the output of commands and spool files. They change to WINDOWS-1252, but I want it in UTF-8 encoding.
I have a bash script that executes sql scripts from directory like this:
sqlplus / <<EOF
whenever sqlerror exit sql.sqlcode
spool $DIR_SPOOL/output
`for script_file in $(ls $DIR_SQL)
do
echo @$DIR_SQL/$script_file
done
`
spool off
EOF
The database character set is AL32UTF8 and linux server uses locale UTF-8. LNS_LANG is AL32UTF8.
The problem is the file encoding of sql scripts from $DIR_SQL. They are developed in WINDOWS-1252 encoding.
The first solution I found was set NLS_LANG to WE8MSWIN1252. The problem is the output of commands and spool files. They change to WINDOWS-1252, but I want it in UTF-8 encoding.
1