Package global variable and embeded SQL problem
504649Jun 6 2008 — edited Jun 7 2008I have developped a package with global variables. At login, I call the package INIT function and fetch some parameters from some table, keep them in global VARCHAR2 variables, declared in the package body:
CREATE OR REPLACE PACKAGE BODY MyPackage
IS
G_Var1 MyTable.MyColumn%TYPE := NULL;
G_Var2 MyTable.MyColumn%TYPE := NULL;
But when I try to use one of these var in an sql, the sql returns nothing. But it should:
SELECT * BULK COLLECT INTO <...> FROM ... WHERE COL_1 = G_Var1
I had to fetch the parameters in a sub query in the where clause of my sql, to make it work, but the performance would be better without this.
Any problem using global package as bind variables ?