Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Package global variable and embeded SQL problem

504649Jun 6 2008 — edited Jun 7 2008
I 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 ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 5 2008
Added on Jun 6 2008
7 comments
617 views