0

I'm executing some random script to my local database and I have problem with non-english letters. When I'm executing the same insert statement directly from sql develeoper everything is ok. Could somebody explain my how can I avoid this problem using sql script? Example. Everything works okay. Statement: insert into my_table values ('aaaaała'); Result: 'aaaaała';

enter image description here

Now I'm pasting the same insert statement into my sql file(script.sql) and I'm wirting:

@'D:\script.sql';

'D:\' - it is location of that file Statement: insert into my_table values ('aaaaała'); Result: 'aaaaała';

The result is wrong:

enter image description here

My settings:

enter image description here

The Impaler
  • 45,731
  • 9
  • 39
  • 76
drk
  • 1
  • 2

1 Answers1

0

You must set your NLS_LANG value according to the character set of the script.sql file. Typically you set this in the options in at the "Save" dialog.

For example if the .sql file was saved as UTF-8 then you must run:

set NLS_LANG=.AL32UTF8
sqlplus .... @'D:\script.sql';

See also OdbcConnection returning Chinese Characters as "?" for more details.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110