The PL / SQL source code is stored in the database in the database character set . Databases using UTF-8 can use UTF-8 also in the PL / SQL source code:
with nls_parameters as ( SELECT 1 as depth, 'SESSION' as "LEVEL", parameter, value FROM nls_session_parameters union all SELECT 2 as depth, 'INSTANCE' as "LEVEL", parameter, value FROM nls_instance_parameters union all SELECT 3 as depth, 'DATABASE' as "LEVEL", parameter, value FROM nls_database_parameters ) select "LEVEL", parameter, '''' || value || '''' as value from nls_parameters where parameter = 'NLS_CHARACTERSET' order by parameter, depth ; LEVEL PARAMETER VALUE
Example:
$ cat /tmp/foo.sql create procedure foo is begin dbms_output.put_line('hello - Σ '); dbms_output.put_line('μεταφρασμένο από το Google!'); end; / $ SQL> @/tmp/foo Procedure created. SQL> exec foo hello - Σ μεταφρασμένο από το Google! PL/SQL procedure successfully completed. SQL>
Another example:
$ cat /tmp/foo.sql create procedure fooΣ is Σ number := 100; begin dbms_output.put_line('hello - Σ = ' || Σ); dbms_output.put_line('μεταφρασμένο από το Google!'); end; / SQL> @/tmp/foo Procedure created. SQL> exec fooΣ hello - Σ = 100 μεταφρασμένο από το Google! PL/SQL procedure successfully completed. SQL>
Please note that I am using a linux terminal that understands UTF-8.
source share