Oracle package global variable seen by procedures, error "PLS-00225: subprogram or cursor reference is out of scope"
Posted on 2013-07-01
I'm trying to use a global variable within a package for all procedures to see that global variable. I tried procedure A.variable_name for global variable.
Here is how I'm trying to use a global variable to pass variables within a package from one procedure A to procedure B but i get an error "PLS-00225: subprogram or cursor reference is out of scope"
CREATE OR REPLACE PACKAGE PKG_1
CREATE OR REPLACE PACKAGE BODY PKG_1
SELECT DISTINCT data
EXIT fetch_A WHEN cur_A%NOTFOUND;
WHERE column_A = rec_A;
IF variable_name_A is NOT NULL THEN
B; -- call procedure B
SELECT x, y, z
INTO v_x, v_y, v_z
WHERE column_P = (A.variable_name_A); --using global variable by using --procedure_name.variable_name