PL/SQL (MOSC)

MOSC Banner

NVL2 in PL/SQL

edited Dec 13, 2014 10:00AM in PL/SQL (MOSC) 4 commentsAnswered

Hello everyone,

I've just found out today that the NVL2 function couldn't be directly used in PL/SQL:

Connected to Oracle Database 11g Release 11.2.0.3.0

Connected as gva

SQL>

SQL> declare

  2    dummy varchar2(10);

  3 

  4  begin

  5       dummy := NVL2('OK', '1', '0');

  6  end;

  7  /

declare

  dummy varchar2(10);

begin

     dummy := NVL2('OK', '1', '0');

end;

ORA-06550: Ligne 6, colonne 15 :

PLS-00201: l'identificateur 'NVL2' doit être déclaré

ORA-06550: Ligne 6, colonne 6 :

PL/SQL: Statement ignored

SQL>

Quite amazing, considering the NVL function can be used this way.

The closest Note I could find is Doc ID 344191.1 : Using NVL2 Function in PL/SQL Fails With PLS-00201

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center