You have to declare this variable in package1 specification

create or replace package pkg1 is
  v_var VARCHAR2(10) := 'Blahblah';
end;
/

create or replace package pkg2 is
  procedure showvar;
end;
/

create or replace package pkg2 body is
  procedure showvar
  begin
    dbms_output.put_line(pkg1.v_var);
  end;
end;
/

exec pkg2.showvar
in SQLPlus prompt should do that

Gints Plivna
IT Sist�mas, Mer�e�a 13, LV1050 R�ga
http://www.itsystems.lv/gints/



                                                                                       
                             
                    Rick_Cale@team                                                     
                             
                    health.com           To:     Multiple recipients of list ORACLE-L 
<[EMAIL PROTECTED]>        
                    Sent by:             cc:                                           
                             
                    [EMAIL PROTECTED]       Subject:     How to use a package variable in 
pkg1 inside of package pkg2  
                    om                                                                 
                             
                                                                                       
                             
                                                                                       
                             
                    2002.01.25                                                         
                             
                    16:35                                                              
                             
                    Please respond                                                     
                             
                    to ORACLE-L                                                        
                             
                                                                                       
                             
                                                                                       
                             




Hi All,

I have a package pkg1 that has a variable var 1 declared

Inside of pkg2 I want to use pkg1.var1. I always get PLS201 identifier
pkg1.var1 must be declared.
What do I need to do to correct.

Pkg1 compiles fine.

Thanks
Rick


--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to