V13 problem with compiling package body from sql file with NVARCHAR2 in it

Dimitri

Member
Hi everybody!
I observe strange PLSQLDev (v13,v11) behavior when compiling package body in SQL window (from SQL file or just with copy/paste) with NVARCHAR2 in it.
See example bellow and try to compile this package in SQL window (not in Command window):

create or replace package xx_dvg_test is
function get_nvarchar return nvarchar2;
end xx_dvg_test;
/
create or replace package body xx_dvg_test is
function get_nvarchar return nvarchar2 is
l_nchar nvarchar2(255) := N'unicode string';
begin
return l_nchar;
end;
end xx_dvg_test;
/

As a result, the package body looks like:

create or replace package body xx_dvg_test is
function get_nvarchar return nvarchar2 is
l_nchar nvarchar2(255) := unistr('\0075\006E\0069\0063\006F\0064\0065\0020\0073\0074\0072\0069\006E\0067');
begin
return l_nchar;
end;
end xx_dvg_test;

I don't like this. How can I prevent this behavior?
 
Last edited:
This is not good for our workflow. We take the package body from the bitbucket repository as SQL file, open this SQL file in SQL window and compiling it.
We don't want automatic converting NVARCHAR strings to UNISTR.
How disable this behavior in SQL window?
- In Command window - all OK
- In Programm window - all OK
What's wrong with SQL window?
 
To resolve this you can also change your client character set to UTF8. To do so for PL/SQL Developer only, edit the Params.ini file in the PL/SQL Developer installation directory and add a line like this:

NLS_LANG=_.UTF8

For example:

NLS_LANG=AMERICAN_AMERICA.UTF8
 
Back
Top