A script-enabled browser is required for this page to function properly.

Unique Names Required within a Package

In PL/SQL V1, when you created a variable with the same name as a procedure or function in the same package, the variable was always used; the identically named procedure or function was ignored. In versions after V1, variables, functions, and procedures within the same package must be unique.

To avoid an error, make sure all procedures within a package have unique names, either by doing so explicitly, or by appending the word Unused to the procedure name.

Note: Post V1, DEBUG becomes DEBUG$$.

Renaming procedure names uniquely in a package Example

This example first presents V1 PL/SQL code that will generate a compiler error, then shows how you might edit the code to avoid the error.

Change this code:

PACKAGE pk1 IS
v1 NUMBER; v1 is established as a variable
PROCEDURE v1; v1 is also established as a procedure
PROCEDURE p2 (x OUT NUMBER);
END;

PACKAGE BODY pk1 IS
PROCEDURE v1 IS
BEGIN
. . .
END;


PROCEDURE p2 (x OUT NUMBER) IS
BEGIN
 x := pk1.v1;

END;
END;

. . . to this:

PACKAGE pk1 IS
v1 NUMBER;
PROCEDURE v1Unused;  The procedure v1 is declared Unused
PROCEDURE p2 (x OUT NUMBER);
END;

PACKAGE BODY pk1 IS
PROCEDURE v1Unused IS
BEGIN
. . .
END;


PROCEDURE p2 (x OUT NUMBER) IS
BEGIN
 x := pk1.v1;
END;
END;

About the PL/SQL V1 conversion utility