1

I would like to ask you help regarding one thing or just your point of view.

We have script in PL/SQL that worked correctly. But now when I want to run it, it doesn´t set up correctly czech words like (ěščěščěřěščřěš).

I read here in stackoverflow to add NCHAR in front of code so I did and It works only when I put this code directly into Toad for Oracle to console. But when I want to upload/run this script per our application then we see ???? instead of correct letters.

I have checked many times UTF-8, I switched between many codings and tested I tried in notepad, PSPadd and nothing works. So this must have something to do with coding properties of this file right?

insert statement

INSERT INTO OUR_TABLE ( Client_No, Contact_Type, 
Postal_Code, Address) Values ('999999','TTT','CZ',RPAD(N'Vladimír 
Müller', 35) ||RPAD(N'Kovozal s.r.o.', 35) || RPAD(N'Zálší 74', 35) || 
RPAD(N'565 01 Zálší', 35));

Old script worked fine without N (NCHAR). But now not. I don´t think that there is another solution than just ask maybe some Oracle admin??

I repeat that N and RPAD works find within the console but admins are not allowed to run this script in console: they have to receive data as file.

What would you do?

Domorodec
  • 91
  • 12
  • 2
    I had similar issue in the past (https://stackoverflow.com/questions/37923536/oracle-plsql-equivalent-of-asciistrnstr). Check your **local** `NLS_LANG` value, i.e. at your client side. Most likely it does not match the character encoding of your SQL*Plus. See this answer for more details: https://stackoverflow.com/questions/33783902/odbcconnection-returning-chinese-characters-as/33790600#33790600 – J. Chomel Sep 10 '18 at 14:26
  • Hi J.Chomel I have checked and it shows me UTF16.... – Domorodec Sep 11 '18 at 07:40
  • We have changed our NLS_LAND to UTF8 and it works now. SOLVED. Thanks – Domorodec Sep 11 '18 at 12:41

1 Answers1

1

SQL Clients in UNIX and in TOAD are different. You were using a different NLS_LANG (UTF16) in your IDE, which made you believe it was displaying wrong chars.

So Solution was to change NLS_LANG to UTF8 in your IDE.

J. Chomel
  • 8,193
  • 15
  • 41
  • 69