Oracle SQL Programming Tips

Execute SQL Script File Encoded in UTF-8 (Windows)

Step1. 查看DB編碼

SQL>SELECT * FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER = ‘NLS_CHARACTERSET’

Step2. 查看Client端編碼

SQL>HOST ECHO %NLS_LANG%

Step3. 設定Client端編碼 (Only for the current session)

C:\set NLS_LANG=.AL32UTF8

Step4. 執行Script File

C:\sqlplus user/pwd@ip:port/SID @[Script File Name] > output.log

※Script File is encoded in UTF-8 without BOM

※如果Client端的編碼不正確,可能會出現ORA-06550、PLS-00114、ORA-00933等錯誤

Continue reading Oracle SQL Programming Tips

Advertisements