René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

nvl2 [Oracle SQL]

nvl2(expr_1, expr_2, expr_3)
Returns expr_3 if expr_1 is null and expr_2 otherwise.

PL/SQL

nvl2 is not a built-in PL/SQL function. The following code raises a PLS-00201: identifier 'NVL2' must be declared error.
declare
  a number;
begin
  a := nvl2(1,2,3);
end;
/
In order to use nvl2 in PL/SQL, it must be part of a select statement:
declare
  a number;
begin
  select nvl2(1,2,3) into a from dual;
  dbms_output.put_line(a);
end;
/

Links

nvl and lnnvl