I 'm using 10g but have same problem:


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 23 15:43:16 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.8.0 - Production

SQL> l
1 CREATE OR REPLACE FUNCTION ORACLE_NVL2 ( VALUE1 VARCHAR2,NOT_NULL_RET VARCHAR2,NULL_RET VARCHAR
2 AS
3 L_RET VARCHAR2(4000);
4 BEGIN
5 L_RET := NVL2(VALUE1, NOT_NULL_RET,NULL_RET);
6 RETURN L_RET;
7 END;
8*
SQL> /

Warning: Function created with compilation errors.

SQL> show errors
Errors for FUNCTION ORACLE_NVL2:

LINE/COL ERROR
-------- -----------------------------------------------------------------
5/5 PL/SQL: Statement ignored
5/14 PLS-00201: identifier 'NVL2' must be declared
SQL>