PL/SQL (MOSC)

MOSC Banner

Global variable value becomes null across procedures in a package body

edited Oct 19, 2023 7:26PM in PL/SQL (MOSC) 3 commentsAnswered

Hi ,

Facing a strange issue today .Global variable value becomes null across procedures in a package body . g_request_id printing blank in the procedure p1 .

Any guess ? Is something wrong in the database ?

create or replace package body xyz as

g_request_id NUMBER;

procedure P1 is

dbms_output.put_line ('g_request_id ='||g_request_id);

end p1;


Procedure p2 is

g_request_id :=1234;

p1;

end p2;

end xyz;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center