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!

How to get value of private package variable?

ronald_2017May 4 2020 — edited May 4 2020

Hi All,

Oracle 11g R2

Is there a way to get value of private package variable?

create or replace package pkg_test

as

    procedure set_var(p1 varchar2);

end;

create package body pkg_test

as

v1 varchar2(100);

    procedure set_var(p1 varchar2)

    as

    begin

        pkg_test.v1 := p1;

    end;

end;

begin

    pkg_test.set_var('hello');

end;

So, is there a way to capture v1 from another session? Because the following gives an error.

begin

    dbms_output.put_line(pkg_test.v1);

end;

Or can I capture the parameter value of pkg_test.set_var? Becasue the variable is set via pkg_test.set_var procedure

Thanks in advance

Comments
Post Details
Added on May 4 2020
15 comments
1,787 views