safe compilation and self-referencing packages

Worker

Member³
When "safe compilation" is turned on, compiling a package that refers to itself (example below) for the first time fails with an "identifier X must be declared" error.

Normally this would work, but because the package is being compiled under a different (temporary) name, it fails.

CREATE OR REPLACE PACKAGE Pkg AS
TYPE NumArray IS TABLE OF VARCHAR2(32767);
myArray Pkg.NumArray;
END Pkg;
 
That is indeed a restriction if you compile the package for the first time. At the moment you need to omit the package prefix (NumArray instead of Pkg.NumArray).
 
Back
Top