Scope specification in a package

Hi,
i read from somewhere that scope can be specified in a package like public function, private function(S) etc... can anyone explain with examples suggesting how private members of a package are accessed?

Any element declared in the package specification is public.
Elements declared in the package body are private for package and can't
be accessed outside of the package.
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10807/09_packs.htm#sthref1138
("Private Versus Public Items in Packages")
Rgds.

Similar Messages

  • Specification about the package oracle.cle.process or oracle.clex

    Where can i find specification about the package oracle.cle.process or oracle.clex?, particularly the class oracle.cle.process.ProcessInfo. I have not could find this specification anywhere, please help me to find it!
    i wait for your help

    This class is part of the MVC Framework. The homepage of this framework on OTN is http://otn.oracle.com/products/ias/9ias_utilities.html#mvc. You can download the user guide and javadoc there. The source code is not publicly available.
    Steven Davelaar,
    JHeadstart Team.

  • Package scope variable

    I created package variables in specification
    of the package.
    And all procedures and function can see these
    variables.
    The question is: What about transaction?
    If two users start using these variables,
    does it influence each other or every user
    will work in his own scope?
    Sorry for dummy question.
    Thanks Anatoly.

    Since Variables declared in the Package variables r global variables will be updated whenever accessed globally.Its not session dependant.
    Might be a problem when two users access it at the same time.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by avalko:
    I created package variables in specification
    of the package.
    And all procedures and function can see these
    variables.
    The question is: What about transaction?
    If two users start using these variables,
    does it influence each other or every user
    will work in his own scope?
    Sorry for dummy question.
    Thanks Anatoly.<HR></BLOCKQUOTE>
    null

  • Grant Execute on package Specification

    How to give grant to package specification to another user?
    The package has only specification and no package body
    in package specification i have defined some constants variables which i need to access from another user?
    Current if i give grant execute from the other user it is shwoing up only blank body......

    Works for me...
    As test_user...
    SQL> create or replace package test_vars is
      2    g_number number := 100;
      3  end;
      4  /
    Package created.
    SQL> grant execute on test_vars to scott;
    Grant succeeded.As scott...
    SQL> create synonym test_vars for test_user.test_vars;
    Synonym created.
    SQL> set serverout on
    SQL> begin
      2    dbms_output.put_line(test_vars.g_number);
      3  end;
      4  /
    100
    PL/SQL procedure successfully completed.
    SQL>

  • Upgrading certain AUR packages when specific official packages change

    I'm having some trouble with updating. As many Archers, I use some packages from AUR. In my case, I'm using bauerbill specifically to update packages from AUR just like I would with pacman. Quite convenient (thx, xyne!)
    But I have some packages that need to be rebuild from AUR when certain official packages are updated, e.g. compiling thinkhdaps against the new kernel version, or updating Lightning and Enigmail from AUR when I update my Thunderbird. However, so far I have not yet found a way to do this: calling specific commands when certain packages are changed.
    Is there any way to do this in pacman or one of the other arch package managers? Or do you have a clue about how to write a script that could do this? Any help would be greatly appreciated.
    Last edited by Natanji (2010-07-22 06:49:54)

    dmz wrote:You could watch (with inotify) the pacman log for specific applications and events. Turn this into a daemon, and execute relevant commands when application X is updated.
    But I think that seems to be a problem as you wouldn't know which applications to keep watching since some might need to be re-built, and others might not.
    I guess watching every package installed outside of pacman (pacman -Qm) would be the only way to see which AUR package needs to be re-built. Depending on how many packages you have installed from AUR or external sources, this could be very fast to extremely slow.

  • Parameter passing from BPF to DM package

    Hi there,
    We have a DM package based on execute formulas that points to custom logic file. We've configured to work using legalentity and time as parameters and we put them on the promt under the SELECTINPUT. Everyting works fine but now I'll like to run it from a BPF step, so I configured same data region on BPF and use the inherit from dataregion on the step that launchs the DM package...for my surprise I need to enter again those values in the package as they come empty on the package selection screen.
    So.... what I'm doing wrong?? Have to use another way to pass parameters to the package??
    Thanks in advance for any help on this.
    Regards,
    Carlos

    You might try to copy the package that you are requesting in the BPF as a back-up.  Then in the package you have connected to the BPF, comment out the SELECTION PROCESS text in the Advanced area of the SSIS package.  Then test the process and review the log to see if the current view or assigned view is passed as a parameter.  If not, then you may have to use a specific package, that has a broader scope defined in the package details or Script logic file itself.
    That would be my first step.

  • SSIS package flow based on a scheduling configuration table.

    I have a table called Tbl_Scheduler.
    This scheduler table contains
    scheduler id ,scheduler description,as shown below.
    1  ,Runs between 10 th of current month and 20th of current month
    2  ,Runs at last day of the month
    3  ,Runs at first day of the month
    Scheduler Id will come from first task(it is given in a configuration table),
    second task should check this scheduler id on scheduler table and
    verify whether the current run date  is falling under the criteria,which is given as scheduler description.
    If it is not,need to stop the package flow.
    SSIS package is scheduled from SQL agent job in every 10 mins.Could you please let us know,how I can design the same.
    Also please feel free to advise to change the table design.

    Stopping running packages is a bad idea in general. You must specifically design a package for being stopped any time which isn't always possible, often not at all.
    And running a package repeatedly in short intervals is not a SOP either.
    To trigger a SSIS package run, the easiest would be via sp_start_job <name> once you have your package set up to run in Agent.
    Arthur My Blog

  • Using global variable in package

    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package. Can someone help me in the declaration of this variable as a global variable? Also, is it necessary for me to initialize this variable whenever the package executes. If yes, how would I do this?
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    FUNCTION Retrieve_SerialNo RETURN VARCHAR2 IS
        v_serial_no VARCHAR2(20);
        CURSOR Serial_Code IS
          SELECT S.Serial_Code
            FROM Spare_Parts s, Orders r
           WHERE s.serial_code = r.serial_code;
      BEGIN
        OPEN Serial_Code;
        LOOP
          FETCH Serial_Code
            INTO v_serial_no;
          EXIT WHEN Serial_Code%NOTFOUND;
          v_serial_no := v_serial_no;
        END LOOP;
        CLOSE Serial_Code;
        RETURN v_serial_no;
      EXCEPTION
        WHEN OTHERS THEN
          RETURN NULL;
      END;

    user13415143 wrote:
    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package.All variables have scope or "visibility". A variable defined in a procedure is only visible within that procedure.
    A variable defines in a package body. is visible within that package body (i.e. procedures and functions in that package body can "see" that variable.
    A variable defined in the package definition? Well, who can see the definitions of procedures and function in a a package header/definition? Everyone else basically (other PL/SQL packages and procedures and functions). So this is also true for variables defined in the package interface. These are global variables that not only can be used by the code in that package's body, but also can be used by other packages and PL/SQL code.
    So when you create a global variable you need to decide on its scope:
    - define it in package header for global usage in all PL/SQL code
    - define it in package body for global usage within that package only
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    ..snipped..Ugly code as there is no need to use an explicit cursor if returning a value from a single row. Also buggy code. If there are multiple rows returned by the cursor, the function returns the serial of the last random row. How does this make sense?
    This is what I would expect to see from a function like this. You pass it a unique identifier and it returns the applicable attribute (column) value for it.
    E.g.
    create or replace function GetSerialNo( orderNo number ) return number is
      serialNo number;
    begin
      select
        s.serial_code into serialNo
      from spare_parts s,
           orders o  
      where s.serial_code = o.serial_code
      and o.order_no = orderNo;
      return( serialNo );
    exception when NO_DATA_FOUND then
      return( null )
    end;Also note that there is no need to write ugly uppercase code. This is not a proper coding standard. Programming standards for all languages (ranging from C# to Java to Delphi to Visual Basic to C/C++) specify that camelcase should be used for variables and pascalcase for procedures/functions/methods. Uppercase is very seldom used and then only for constant names and compiler options/flags for example.
    Coding reserved words in uppercase? That is just plain silly - and not found in today's programming languages. Do yourself a favour and forget the idiotic standards used by some for PL/SQL and look at the standards for Java and .Net/C# - as the latter are the de facto standards for programming (and have been for the last 2 decades and more).

  • Dynamic connection string not working in SSIS package 2008R2

    I am using SSIS package for Import data from excel sheet to SQL DB. In the configuration file I'm using following variables.
    Name scope DataType Value
    DBName package String DB_Master
    Password package String xx
    UserName package String sa
    ServerName package String xxx.xxx.x.xx
    SqlConnectionString package String DataSource=xxx.xxx.x.xxx;UserID=sa;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;Initial Catalog=DB_Master;Password=xx
    Right click OLEDB ConnectionManager then click properties window below values assign
    ConnectionString - Initial Catalog=DB_Master;DataSource=xxx.xxx.x.xxx;UserID=sa;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;
    DelayValidation - True
    Expressions -ConnectionString - @[User::SqlConnectionString]
    In SqlConnectionString variable properties window below values assign
    EvaluateAsExpression -True
    Expression -"DataSource=" + @[User::ServerName] + ";UserID=" + @[User::UserName] + ";Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;Initial Catalog=" + @[User::DBName] + ";Password=" + @[User::Password]
    After deploy the package file I change the DBName in SqlConnectionString DB_Master to Master but package execute the files in DB_Master.
    and also if i give invalid ServerName like 198.152.1 but package executed successfully.
    Please tell me where i made mistake. what's goes wrong...?
    I just use variable like below link
    https://anothersqlgeek.wordpress.com/2013/03/28/ssis-dynamic-connections-part-1/comment-page-1/#comment-48

    First see whether you've some other configurations also set inside the package for the same properties? ie direct configuration for connection manager properties.
    Secondly see if its executed from a job and you're overriding the values through the job properties.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Package Error(HELP)

    Hi,
    I am trying to write a package but occurs Errors. Anyone Can Help me?
    Tanks,
    Luis Paulo
    Create Package body test as
    procedure strReturn(input in varchar2,output out varchar2) as
    begin
    output := input;
    end;
    end;
    LINE/COL ERROR
    0/0 PL/SQL: Compilation unit analysis terminated
    1/14 PLS-00201: identifier 'TEST' must be declared
    1/14 PLS-00304: cannot compile body of 'TEST' without its
    specification
    null

    Create the package specification first.
    'Create or replace Package test as
    procedure strReturn(input in varchar2,output out varchar2) ;
    end;
    Then create the package body
    'Create or replace Package body test as
    procedure strReturn(input in varchar2,output out varchar2) as
    begin
    output := input;
    end;
    end;
    Good luck!
    null

  • PLS-00304: cannot compile body of 'PA_TIME_CLIENT_EXTN' without its specifi

    Hi expert,
    We are trying the validate the PA_TIME_CLIENT_EXTN package body. It is giving the below error.
    0/0 PL/SQL: Compilation unit analysis terminated
    1/14 PLS-00905: object APPS.PA_TIME_CLIENT_EXTN is invalid
    1/14 PLS-00304: cannot compile body of 'PA_TIME_CLIENT_EXTN' without
    its specification
    My environment details are as below.
    Oracle apps version: 11.5.10.2
    DB version : 11.2.0.1
    OS version : IBM AIX 6.1
    Please help me on this.
    Thanks

    This error is usually seen when you have a different datatype specification in your package specification and your package body. I think that is some thing you might want to check first.
    Regards,
    Johan Louwers

  • Minimum playback spec for packaged flash game

    I can't seem to find any definitive information on the
    minimum playback specification of Flash packaged applications.
    I am developing a series of games for both Mac and PC and
    would like to include a minimum playback specification.
    I will be using Flash CS3 to develop the games and publishing
    the games as Flash 8 and Action Script 2.
    Any help much appreciated!

    ChuckyLeFrek wrote:
    > I can't seem to find any definitive information on the
    minimum playback
    > specification of Flash packaged applications.
    >
    > I am developing a series of games for both Mac and PC
    and would like to
    > include a minimum playback specification.
    >
    > I will be using Flash CS3 to develop the games and
    publishing the games as
    > Flash 8 and Action Script 2.
    >
    > Any help much appreciated!
    Follow the Software installation specs. If it is meant for
    installation on some
    kind of minimum specs, I believe they take the player back
    under consideration as well.
    I normally follow the Flash Authoring tool specs when the
    client asks. Always better
    to have some spare margin of tolerance for more cpu intensive
    content, like larger
    images and videos...
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Privilege to view Package DDL only

    Hello Friends,
    I need your help on GRANTS.
    Oracle version: Oracle 11G R2
    OS: AIX
    I have three users in a database. Among these three users, two users, say USR1 and USER2 are having all database objects which is needed for my application and poses all system privileges equivalent to a DBA role.
    The 3rd one I have created is a READ user. I want this user to view only source code of PACKAGES AND PACKAGES BODY objects of only USR1, not USR2. Also, I have more than thousand packages/package bodies in USR1. READ should not be able to CREATE or compile a procedure, just simply be able to view the source code.
    FYI, GRANT EXECUTE enables me to see PACKAGE specific only, not PACKAGE BODY.
    Which privilege should I grant to READ user to achieve this security?
    Please help.

    AshishGautam wrote:
    Hello Friends,
    I need your help on GRANTS.
    Oracle version: Oracle 11G R2
    OS: AIX
    I have three users in a database. Among these three users, two users, say USR1 and USER2 are having all database objects which is needed for my application and poses all system privileges equivalent to a DBA role.
    The 3rd one I have created is a READ user. I want this user to view only source code of PACKAGES AND PACKAGES BODY objects of only USR1, not USR2. Also, I have more than thousand packages/package bodies in USR1. READ should not be able to CREATE or compile a procedure, just simply be able to view the source code.
    FYI, GRANT EXECUTE enables me to see PACKAGE specific only, not PACKAGE BODY.
    Which privilege should I grant to READ user to achieve this security?
    Please help.CREATE OR REPLACE PROCEDURE READ_MY_SOURCE ...
    -- which SELECT TEXT FROM USER_SOURCE ORDER BY LINE
    have this procedure owned be both USR1 & USER2
    GRANT EXECUTE ON USR1.READ_MY_SOURCE TO READ;
    GRANT EXECUTE ON USR2.READ_MY_SOURCE TO READ;

  • When should be package invalidated?

    Hello guys,
    I would need again some help...
    My question is: When exactly should be package invalidated?
    Consider following situation:
    We have two packages, one contains constants (in its specification), the other is reading these constants. Package is reading these constants in package body and package spec as well. Now, when I add a new constant to the first package and recompile it, should this invalidate the other package??? The new added constant is not used in the other package.
    In reality, we have a Constant package, containing all constants in its specification. One package (test_pkg) is reading some constant let say form line 100. Now we add new constant let say to line 50. When we recompile the constant package, planty of packages get invalidated because they are reading from it. We recompile all invalid packages. However test_pkg is not invalidated!!! Now if we run the code from test_pkg, it is still reading the constant from line 100, so it is reading it from wrong place and the constant has wrong value! The only thing what help is to recompile the test_pkg.
    So it looks like the reference to Constant package wasn't updated.
    Why isn't test_pkg invalidated???
    Oracle version:
    SELECT * FROM V$VERSION;
    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE     11.2.0.1.0     Production"
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    From my standard library of responses...
    Packages tend to fail because of their "package state". A package has a "state" when it contains package level variables/constants etc. and the package is called. Upon first calling the package, the "state" is created in memory to hold the values of those variables etc. If an object that the package depends upon e.g. a table is altered in some way e.g. dropped and recreated, then because of the database dependencies, the package takes on an INVALID status. When you next make a call to the package, Oracle looks at the status and sees that it is invalid, then determines that the package has a "state". Because something has altered that the package depended upon, the state is taken as being out of date and is discarded, thus causing the "Package state has been discarded" error message.
    If a package does not have package level variables etc. i.e. the "state" then, taking the same example above, the package takes on an INVALID status, but when you next make a call to the package, Oracle sees it as Invalid, but knows that there is no "state" attached to it, and so is able to recompile the package automatically and then carry on execution without causing any error messages. The only exception here is if the thing that the package was dependant on has changes in such a way that the package cannot compile, in which case you'll get an Invalid package type of error.
    And if you want to know how to prevent discarded package states....
    Move all constants and variables into a stand-alone package spec and reference those from your initial package. Thus when the status of your original package is invlidated for whatever reason, it has no package state and can be recompiled automatically, however the package containing the vars/const will not become invalidated as it has no dependencies, so the state that is in memory for that package will remain and can continue to be used.
    As for having package level cursors, you'll need to make these local to the procedures/functions using them as you won't be able to reference cursors across packages like that (not sure about using REF CURSORS though.... there's one for me to investigate!)
    This first example shows the package state being invalided by the addition of a new column on the table, and causing it to give a "Package state discarded" error...
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  /
    Table created.
    SQL>
    SQL> insert into dependonme values (5)
      2  /
    1 row created.
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  /
    Package created.
    SQL>
    SQL> create or replace package body mypkg is
      2    v_statevar number := 5; -- this means my package has a state
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
    10
    11      myval := myval * v_statevar;
    12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
    13    end;
    14  end mypkg;
    15  /
    Package body created.
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALID
    SQL>
    SQL>
    SQL> alter table dependonme add (y number)
      2  /
    Table altered.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    BEGIN mypkg.myproc; END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG"
    ORA-06512: at line 1
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALIDAnd this next example shows how having the package variables in their own package spec, allows the package to automatically recompile when it is called even though it became invalidated by the action of adding a column to the table.
    SQL> drop table dependonme
      2  /
    Table dropped.
    SQL>
    SQL> drop package mypkg
      2  /
    Package dropped.
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  /
    Table created.
    SQL>
    SQL> insert into dependonme values (5)
      2  /
    1 row created.
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  /
    Package created.
    SQL>
    SQL> create or replace package mypkg_state is
      2    v_statevar number := 5; -- package state in seperate package spec
      3  end mypkg_state;
      4  /
    Package created.
    SQL>
    SQL> create or replace package body mypkg is
      2    -- this package has no state area
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
    10
    11      myval := myval * mypkg_state.v_statevar;  -- note: references the mypkg_state package
    12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
    13    end;
    14  end mypkg;
    15  /
    Package body created.
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALID
    SQL>
    SQL> alter table dependonme add (y number)
      2  /
    Table altered.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.

  • Problems streaming specific App-V applications from specific distribution point. Cannot find any KB article on the error?

    Hi there,
    Some clients are having trouble streaming specific app-v packages from a specific distribution point.
    sftlog.txt shows the following on the client:
    [05/14/2014 10:39:25:442 AMGR WRN] {tid=E7C}
    Attempting Transport Connection
    URL:
    https://APPVSERVER:443/NOCERT_SMS_DP_SMSPKGE$/VirtualAppStreaming/AGR00215/{85738DDB-F118-48F3-9459-47354509E464}/AGR00215.sft
    Error: 2460410A-40002EFD
    [05/14/2014 10:39:25:458 JGSW ERR] {hap=34:app=APPNAME 2.0 2.0.0.0:tid=1334:usr=*****}
    The Application Virtualization Client could not connect to stream URL 'https://APPVSERVER:443/NOCERT_SMS_DP_SMSPKGE$/VirtualAppStreaming/AGR00215/{85738DDB-F118-48F3-9459-47354509E464}/AGR00215.sft' (rc 2460410A-40002EFD, original rc 2460410A-40002EFD).
    [05/14/2014 10:39:25:458 SWAP ERR] {hap=34:app=APPNAME 2.0 2.0.0.0:tid=1334:usr=****}
    The client was unable to connect to an Application Virtualization Server (rc 2460410A-40002EFD)
    I have recreated the DP based on the best practice for removing the DP and re-adding, as we've had other app issues which needed tidying up, but that has not fixed this issue.
    I have searched for the above error (The client was unable to connect to an Application Virtualization Server (rc 2460410A-40002EFD) but I get no results.
    Please help me with this, I've deleted the DP content and re distributed the content to the DP with no change.. If I remove the DP, the content is able to be streamed from other DP's no problem.
    Cheers
    Max
    Max Christopher

    It looks as though this may have been sorted out  - A re bind of the computer cert on the DP to the default website https binding seems to have resolved this for me.
    Max Christopher

Maybe you are looking for