Home > OS >  How to use special characters in Oracle PL/SQL?
How to use special characters in Oracle PL/SQL?

Time:10-17

I have the following package

    CREATE OR REPLACE PACKAGE BODY MyPackage is
        function Somefunction return varchar2 is
        begin
            return 'some text with special characters like é or è';
        end;
    end package;

The package compiles however when executed, the text returned doesn't include the special characters :

    some text with special characters like � or �

I'm using plsql allround automation and, as far as I know, it's configured to use UTF-8 charset :

enter image description here

Unicode is also enabled as can be seen in the screenshot here.

And running the following query :

    select * from NLS_DATABASE_PARAMETERS where parameter='NLS_CHARACTERSET';

return :

    AL32UTF8

Does anyone know how to solve that please ?

CodePudding user response:

Solution as per @AlexPoole comments :

Add the following environment variable in Windows :

NLS_LANG : LANGAGE_COUNTRY.UTF8

  • Related