Scope of variables in the package or interface level

Hello

Can we define the scope of the ODI project at the level of the interface or package variables
because in my project im using a last refresh rundate variable will change the value of the variable at the time of execution of each package.

Thanxs
Malezieux

You can create it as 'No persistent' and then its value exist by session ODI.

In this way, several sessions may keep an independent value to the same variable.

Tags: Business Intelligence

Similar Questions

  • How do I update the second variable in the package

    Hi all

    I created variables Var1, Var2 with different query refreshing, now I'm using these variables in the package to give inputs to the procedure, drag variables in the package and also declaring variables and once drag aging two variables defined as refresh variables and related to the procedure, has developed a scenario run the package my package was running successfully but second variable Var2 was not only refreshing the first variable will be refreshing, how should I refresh second variable also? Any suggestions are appreciated,

    Hmm, I'll give you solid evidence

    http://dwteam.in/WP-content/uploads/2013/01/OTN1.jpg

    Thank you

  • By passing the package variables to the package...

    Hello world

    I have the following problem:

    Package A compiled in scenario A - not referencing not date of process.
    Package B compiled in scenario B with declare the flow variable called ProcessDate.
    Package MAIN calling declare variable ProcessDate, then calling scenario A, then B Scenario and then ENDS.

    MAIN scenario created with the ProcessDate startup parameter.

    So I want to start the MAIN scenario, with a parameter to ProcessDate. He asks me for the setting, but then scenario B fails as if he did not get the parameter. However, when I run the only TI, scenario B works very well after asking for the value of the parameter.

    any help appreciated.
    Thank you!
    Nick

    Hi Nick,

    When you drop scenario B in the main package, please do not forget to pass the variable processdate to scenario B. This can be done by using the additional Variables tab in the scenario using the menu drop down.

    Thank you
    Ritika

  • ORA-04068: current state of the packages was waived - avoid

    Hello
    I fight with the bad behavior of developers that is, something like this:
    CREATE OR REPLACE PACKAGE pkg1 IS
    
    g_version VARCHAR2(20) := '7.3';
        TYPE t_id_kon IS RECORD(
        id_kon VARCHAR2(12),
        sr_id    NUMBER(5));
    
      TYPE t_id_kont IS TABLE OF t_id_kon INDEX BY BINARY_INTEGER;
      FUNCTION get_version RETURN VARCHAR2;
    END pkg1;
    /
    I did some tests and looks like when you recompile pkg1 with
    Global g_version variable it is ORA-04068 generated for all sessions using this pkg1 before recompiling.
    But what about type and table_type declared in pkg1 they cause same behavior as g_version global varialbe?

    And generally how to treat than the types of situations of application point of view, you must catch this exception and re-run your application just?
    concerning
    GregG

    Packages tend to fail because of their 'package '. A package has a 'State' when it contains the package variable and constant level etc. and the package is called. On the first calling package, the 'State' is created in memory to hold the values of these variables, etc. If an object including the package depends on for example a table is changed somehow example deleted and recreated due to data dependencies, the package then takes a State not VALID. When you do then appealed to the package, Oracle examines the status and see that it is not valid, then determines that the package has a "State". Because something changed the package depended on, the State is taken as being obsolete and is ignored, which causes the error "State package has been abandoned" message.

    If a package has no variables of level package etc. i.e. the 'State' and then, taking the same example above, the whole takes an INVALID state, but when you make then a call to the package, Oracle considers as invalid, but knows that there is no 'State' attached to it and is therefore able to recompile the package automatically and then continue execution without causing error messages. The only exception here is if the thing that the package was dependent on a change of such kind that the package may not compile, in which case you will get an invalid error package type.

    And if you want to know how we prevent Jetty package States...

    Move all variables and constants in a stand-alone package specification and to refer to those of your original package. So when the status of your original packing is invlidated for some reason, it has no State package and can be recompiled automatically, however the packaging containing the vars/const is not cancelled because it has no dependencies, so the State that is in memory for this package will remain and may continue to be used.

    As for package-level sliders, you will need to make these premises to the procedures/functions using them as you won't be able of sliders reference in all of packages like that (not sure on the use of the REF CURSOR but... exists for me to study!)

    This first example shows the State being disabled by adding a new column on the table and causing to give a 'Package State scrapped' 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        VALID
    

    And the following example shows how to get the package in their own specifications of package variables, allows the package to automatically recompile when it is called even if it has become invalid by the action to add 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.
    
  • error ORA-4068:-l' current state of the package is invalidated

    Hai friends,

    Please see this link

    Problem we faced, it is ' error ora-4068:-l' current state of the package is disabled "in the application.initiallly of customer, we migrated to oracle 9i and 10g 10.2.0.4.0

    We have discussed and obtained the solution as the timestamp of the objects may be different. (we expect the access rights of the table sys.obj$) pls see the link

    Re: oracle error-4068

    But now we are informed senior as below

    (1) error ora-4068 will come only when recompile us the view. is this true?

    (2) 6136074 bug is fixed in 10.2.0.4.0. is it?

    Gurus of give your valuable suggestions

    S

    Packages tend to fail because of their 'package '. A package has a 'State' when it contains the package variable and constant level etc. and the package is called. On the first calling package, the 'State' is created in memory to hold the values of these variables, etc. If an object including the package depends on for example a table is changed somehow example deleted and recreated due to data dependencies, the package then takes a State not VALID. When you do then appealed to the package, Oracle examines the status and see that it is not valid, then determines that the package has a "State". Because something changed the package depended on, the State is taken as being obsolete and is ignored, which causes the error "State package has been abandoned" message.

    If a package has no variables of level package etc. i.e. the 'State' and then, taking the same example above, the whole takes an INVALID state, but when you make then a call to the package, Oracle considers as invalid, but knows that there is no 'State' attached to it and is therefore able to recompile the package automatically and then continue execution without causing error messages. The only exception here is if the thing that the package was dependent on a change of such kind that the package may not compile, in which case you will get an invalid error package type.

    And if you want to know how we prevent Jetty package States...

    Move all variables and constants in a stand-alone package specification and to refer to those of your original package. So when the status of your original packing is invlidated for some reason, it has no State package and can be recompiled automatically, however the packaging containing the vars/const is not cancelled because it has no dependencies, so the State that is in memory for this package will remain and may continue to be used.

    As for package-level sliders, you will need to make these premises to the procedures/functions using them as you won't be able of sliders reference in all of packages like that (not sure on the use of the REF CURSOR but... exists for me to study!)

    This first example shows the State being disabled by adding a new column on the table and causing to give a 'Package State scrapped' 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        VALID
    

    And the following example shows how to get the package in their own specifications of package variables, allows the package to automatically recompile when it is called even if it has become invalid by the action to add 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.
    
  • How to pass the parameter to the script for interface/Package in ODI

    Hello

    Yesterday I asked a question how to pass a parameter to run the script interface or the procedure?

    I don't know if it's possible.

    Any clarification will help you.

    Kind regards

    Mahesh

    Mahesh, why not try this in your machine? This will give you more clarity and confidence.

    ODI has always check if there is any variable used inside an object regardless of the interface or procedure or package. So whenever you generate the script, you will be asked to select the boot parameters. She's. Whenever you use this scenario, make sure you that you add the variables in the additional variables section of the Properties tab.

    So answer is that it is possible.

    Bravo!

  • using Record statistics for session/Interface inside the package

    Oracle DB / ODI.
    I have a package starting with Interface.
    In the second step, I want to know how many records has been inserted/updated the first interface. Let that say those numbers will be used on the second interface.
    How can I do? Is it possible to access this information inside the package?
    Something similar to SQL % ROWCOUNT in ODI?

    Try this in variable refresh

    Select to_number (< %="odiRef.getPrevStepLog("INSERT_COUNT")%">) + to_number (<%=odiRef.getPrevStepLog("UPDATE_COUNT")%>) of the double

  • Using variables in the interface

    Hello

    I have a variable which contains this statement: select max (ID) + 1 from table1
    In an interface I try to map the ID from table1 with this variable, but I still have the same error: violation of KP.

    I tried with a problem too but same sequence

    Hello

    I believe that this happens because of the following

    (1) your target T table has a PK/UK set on column ID.
    (2) variable in the select query is: select max (ID) + 1 t
    (3) to assume that select max (ID) + 1 t returns 5
    (4) now in the package you refresh the Variable, and it is up to 5 for all lines
    (5) 1st row insertion will work as ID column becomes a new value so no PK/UK breach
    (6) but 2nd, 3rd... .Nth line insert also get value from column ID 5! By thus breach PK/UK

    Thank you
    Fati

  • Cannot use the variable in the Interface.

    Hello

    I create a variable in the reference to 11g odi below

    V_name = FTClient

    DataType = alphanumeric

    default value = "BANK 1"

    I create a filter on the source table to pull records only for 1 BANK and talk CELL_SRC_TBL1. CLIENT = #FTClient in the filter.

    But when I try to execute its error display interface.

    "Caused by: java.sql.SQLSyntaxErrorException: ORA-00936: lack of expression.

    Thank you

    Paul

    You use ODI 11? If so the name of the variable must bee all uppercase and when you pass too!

    I hope this can help you!

  • Database trigger can not see the package global variable after assign in my form

    Hello

    I faced the problem with the trigger and the package variable global using the form designer

    first of all, I get the local IP address machine using WEBUTIL in triggering of the PREFORM and initialize my global package variable by ' Client_Info_Pkg.Set_IP_Address (WEBUTIL_CLIENTINFO.» GET_IP_ADDRESS); ", then I tried to make the DML operation in my form and at the same time I trigger database also uses the package global variable of" Client_Info_Pkg.Gand_IP_Address; "to read in the package, and then insert it into the audit table


    The question this database trigger may not feel the initialization "Client_Info_Pkg.Set_IP_Address (WEBUTIL_CLIENTINFO. GET_IP_ADDRESS)' I did in triggering of the PREFORM and I used to wonder if oracle create new session to run this trigger so he can't see my boot or what?!. .

    the package

    CREATE OR REPLACE PACKAGE Client_Info_Pkg

    Global_IP_Address VARCHAR2 (100);

    FUNCTION Get_IP_Address RETURN VARCHAR2;

    PROCEDURE Set_IP_Address (p_Machine_Name IN VARCHAR2);

    END Client_Info_Pkg;

    /

    CREATE OR REPLACE PACKAGE BODY Client_Info_Pkg

    FUNCTION Get_IP_Address RETURN VARCHAR2 IS

    BEGIN

    RETURN Global_IP_Address;

    END;

    PROCEDURE Set_IP_Address (p_IP_Address IN VARCHAR2) IS

    BEGIN

    Global_IP_Address: = p_IP_Address;

    END;

    END Client_Info_Pk

    relaxation

    --------------

    CREATE OR REPLACE TRIGGER RUNERP.FO_DOC_TYPES_L_T

    BEFORE INSERT OR UPDATE OR DELETE ON FO_DOC_TYPES

    REFERRING AGAIN AS NINE OLD AND OLD

    FOR EACH LINE

    BEGIN

    IF THE INSERTION

    RUN IMMEDIATELY ' INSERT INTO FO_DOC_TYPES_LOG

    VALUES ("I",: DOC_TYPE_ID,: DOC_TYPE_VALUE,: DOC_TYPE_NAME,: Vip_Address' HELP: NEW.) DOC_TYPE_ID,: NEW. DOC_TYPE_VALUE,: NEW. DOC_TYPE_NAME, Client_Info_Pkg.Get_IP_Address;

    END IF;

    IF THE UPDATE CAN

    RUN IMMEDIATELY ' INSERT INTO FO_DOC_TYPES_LOG

    VALUES ("U",: DOC_TYPE_ID,: DOC_TYPE_VALUE,: DOC_TYPE_NAME,: Vip_Address) "USING: NEW." DOC_TYPE_ID,: NEW. DOC_TYPE_VALUE,: NEW. DOC_TYPE_NAME, Client_Info_Pkg.Get_IP_Address;

    END IF;

    IF REMOVE THEN

    RUN IMMEDIATELY ' INSERT INTO FO_DOC_TYPES_LOG

    VALUES ("D",: DOC_TYPE_ID,: DOC_TYPE_VALUE,: DOC_TYPE_NAME,: Vip_Address) "USING: NEW." DOC_TYPE_ID,: NEW. DOC_TYPE_VALUE,: NEW. DOC_TYPE_NAME, Client_Info_Pkg.Get_IP_Address;

    END IF;

    END;

    /

    Thanks in advance

    I solved my problem by using the CONTEXT object, Michael thank you for your interest.

  • Appellant the package with the cursor type and registration type variables

    Hello
    I tried the following package, which is similar to my requriement, the package has been successfully created, when you call it gives me error, the number of false arguments
    CREATE OR REPLACE PACKAGE Pkg_test1
    IS
      ----- Record Variable ----
      TYPE rec_job IS RECORD
       ( job varchar2(50),
         ename varchar2(50),
         sal number
       );
      TYPE typ_job IS TABLE OF rec_job;
      
      -- cursor declaration
      cursor emp_cur is select empno from  emp;
      TYPE emp_ttyp IS TABLE OF emp_cur%ROWTYPE INDEX BY PLS_INTEGER;
      ---- Procedure Declaration ----
    PROCEDURE proc_job ( p_cur IN   emp_ttyp,
                         o_Rat     OUT  typ_job );
     
    END Pkg_test1;
    /
    
    CREATE OR REPLACE PACKAGE BODY Pkg_test1
    IS
     
     PROCEDURE proc_job ( p_cur IN   emp_ttyp, o_Rat     OUT  typ_job )
      IS 
        -- Declare collection variable 
        l_typ_job typ_job; 
     
    BEGIN
       for i  in 1..p_cur.count loop
        select job,ename,sal bulk collect into l_typ_job
          from emp
          where empno=p_cur(i).empno ; 
    o_Rat:= l_typ_job;
    end loop;
    --Output
    for i in 1..o_rat.count loop
     DBMS_OUTPUT.PUT_LINE ( 'Output :'||o_rat(i).job||','||o_rat(i).ename||','||o_rat(i).sal );
      end loop;
    
    EXCEPTION
      WHEN OTHERS THEN 
           DBMS_OUTPUT.put_line('Procedure proc_job  - '|| SQLCODE|| '-'|| SQLERRM);
     END proc_job;
      end pkg_test1;
    /
    The package is created without errors
    But during the call, it gives me errors
    DECLARE 
      P_CUR PKG_TEST1.emp_ttyp;
      O_RAT PKG_TEST1.rec_job;
    BEGIN 
      PKG_TEST1.PROC_JOB ( P_CUR, O_RAT );
      COMMIT; 
    END; 
    Error is:
    PLS-00306: wrong number or types of arguments in call to 'PROC_JOB'
    Can you let me see how to overcome this error...

    Thank you..

    Published by: Smile on 9 may 2012 07:27
    SQL> DECLARE
      2  P_CUR PKG_TEST1.emp_ttyp;
      3  O_RAT PKG_TEST1.typ_job := PKG_TEST1.typ_job(null);
      4  BEGIN
      5  PKG_TEST1.PROC_JOB ( P_CUR, O_RAT );
      6  END;
      7  /
    Procedure proc_job  - -6531-ORA-06531: Reference to uninitialized collection
    
    PL/SQL procedure successfully completed.
    
    SQL> CREATE OR REPLACE PACKAGE BODY Pkg_test1
      2  IS
      3
      4   PROCEDURE proc_job ( p_cur IN   emp_ttyp, o_Rat     OUT  typ_job )
      5    IS
      6      -- Declare collection variable
      7      l_typ_job typ_job := typ_job();
      8
      9  BEGIN
     10     for i  in 1..p_cur.count loop
     11      select job,ename,sal bulk collect into l_typ_job
     12    from emp
     13    where empno=p_cur(i).empno ;
     14  o_Rat:= l_typ_job;
     15  end loop;
     16  --Output
     17  if o_rat is null then return; end if;
     18  for i in 1..o_rat.count loop
     19   DBMS_OUTPUT.PUT_LINE ( 'Output :'||o_rat(i).job||','||o_rat(i).ename||','||o_rat(i).sal );
     20    end loop;
     21  EXCEPTION
     22    WHEN OTHERS THEN
     23     DBMS_OUTPUT.put_line('Procedure proc_job  - '|| SQLCODE|| '-'|| SQLERRM);
     24   END proc_job;
     25    end pkg_test1;
     26  /
    Package body created.
    
    SQL> DECLARE
      2  P_CUR PKG_TEST1.emp_ttyp;
      3  O_RAT PKG_TEST1.typ_job;
      4  BEGIN
      5  PKG_TEST1.PROC_JOB ( P_CUR, O_RAT );
      6  END;
      7  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • How to use variable bin in the package without asking a user?

    Hello

    I would write a SQL but I want to use bind variable as static package, without asking the user? As below?

    I would ask you, below it is a variable emp_id? Is this variable BINDING?

    DECLARE
    bonus NUMBER (8.2);
    emp_id NUMBER (6): = 100;
    BEGIN
    SELECT salary * 0.10 IN employees OF bonus
    WHERE employee_id = emp_id;
    END;
    /

    If this isn't the case, as this SQL, how can define a CONNECTION variable as static inside a code? don't ask a user?
    version of DB. 9.2.0.8

    best regards and thank you

    OracleADay wrote:

    I would write a SQL but I want to use bind variable as static package, without asking the user? As below?

    Yes, as you did in this code example.

    All SQL statements must be analyzed as sliders to be filled. PL/SQL source code can contain code PL/SQL (programming language) and the source SQL.

    So, indeed you are coding 2 languages of different source code in the same source program. The PL/SQL compiler is a pretty smart to understand what is PL/SQL code and what is the SQL code. To obtain the SQL source code, he creates transparently calls to the SQL engine - this call to the SQL engine will contain instructions on how to analyze the SQL and bind constants or variables in PL/SQL to SQL.

    The SQL engine saves the sliders in the Shared Pool (the memory of the SGA structure) of Oracle. And you can easily watch the content of the present to see what SQLs cursors here - and what bind variables, if any, they use.

    I posted an example - creating a procedure containing a SQL, execution of the PL/SQL code and then watching the cursor that has been created in the shared Pool. See {message identifier: = 2243507}. And it's a little easier to do that (more detailed) SQL tracing approach Pierre indicated above.

    If this isn't the case, as this SQL, how can define a CONNECTION variable as static inside a code? don't ask a user?

    A PL/SQL variable or a constant that you use in a SQL statement in the PL/SQL code, will be treated as a variable binding when parsing SQL and create the cursor so that it (or re - using an existing cursor).

  • Overall reading series variable in the database package

    Hello.

    I'm having problems using interactive report. The problem lies in the view that serves as a data source in this interactive report. The view has some where clause that references previously defined package global variable. The first time the page is rendered to the query works well. It's because I've created processes of "on the load - before the header" which defines global variables in the data package. The problem is when I type just report interactive button 'Go' of the "no data found" is triggered. I nailed the problem until I know that after hitting the "Go" button the apex using a new database connection and logically it the value of database package global variables have the value NULL. My first idea was to change the Point of 'process' (so the process would fire whenever you press the "Go" button), but I could not find the corresponding point.

    So my question is if there is a way to overcome this problem.

    Best regards

    Can you try to set the context by using the attribute MEV of demand? Just put an anonymous block in there.

    Scott

  • Why we need to create the package instead of procedure or function in Oracle

    Hello

    Recently, I attended an interview, they asked,
    why we must create the package instead of procedure or function in oracle. Is a specific advantage, if we create together.
    I'm not sure. can u tell me please someone.

    Thank you and best regards,
    Sanjeev.

    Hello

    A part of the oracle documentation.

    What is a PL/SQL Package?
    A package is a schema object which includes subroutines, variables, and logically related PL/SQL types. Packages have two parts: a specification (spec) and a body. Sometimes, the body is unnecessary. The specification is the interface to the package. It declares the types, variables, constants, exceptions, cursors, and subprograms that can be referenced from outside the package. The body defines queries for the sliders and the code for the subprogrammes.

    Benefits of the PL/SQL Packages
    Packages have a long history in software engineering, offering important characteristics for a reliable, maintainable, and reusable code, often in team for large systems development efforts.

    Modularity

    Packages allow you to logically encapsulate Associates types, elements, and subroutines in a module named PL/SQL. Each package is easy to understand, and the interfaces between packages are simple, clear and well defined. This facilitates the development of applications.

    Easier application design

    When you design an application, all you need initially is the interface information in the package specification. You can code and compile a spec without his body. Stored subprograms that reference the package can then be compiled as well. You should not set the package body entirely until you are ready to complete the application.

    Information masking

    With packages, you can specify which types, elements, and subprogrammes are (and accessible) public or private (hidden and inaccessible). For example, if a package contains four subprogrammes, three can be public and one private. The package hides the implementation of the subprogramme private so that only the package (not your application) is affected if the application changes. This simplifies maintenance and improvement. Also, by hiding the implementation details of the users, you protect the integrity of the packaging.

    Feature added

    Sliders and packed public variables persist for the lifetime of a session. They can be shared by all the subprogrammes that are running in the environment. They allow you to manage data in any of the transactions without storing in the database.

    Best performance

    When you call a subprogram packaged for the first time, the whole package is loaded into memory. Subsequent calls to related subprograms in package require no disk i/o.

    Packets stop cascading dependencies and avoid an unnecessary recompilation. For example, if you change the body of a packaged function, Oracle does not recompile other routines that call the function; These routines only depend on parameters and return value that are declared in the specification, so they are recompiled only if the specification changes.

  • What is the package?

    Hello

    can u describe to me what is the package?

    How to check?

    Hello

    A package is a schema object which includes subroutines, the elements and the logically related PL/SQL types. Packages have two parts: a specification and a body, although sometimes the body is not necessary. The specification (spec for short) is the interface to your applications; It declares the types, variables, constants, exceptions, cursors, and available for use of subprogrammes. The body fully defines cursors and subprograms, and so implements the specification.

    see the link below:

    http://docs.Oracle.com/CD/B10501_01/AppDev.920/a96624/09_packs.htm

Maybe you are looking for

  • Re: Satellite A300-15 b Model_No: PSAJ4E and windows XP

    Hi guys,. I bought Toshiba Satellite A300-15 b model_No: PSAJ4E and I am trying to install windows XP. but when the installation message comes out says no hard drive found. I know that this question that I have to use the disk driver hard for allows

  • AG3-605: CPU cooler for the cpu: which?

    As I am closed for rebuild my AG3-605 with a new motherboard (the same as the damaged), I want to try a new CPU cooler. It's not easy to find one. Noctua NH - L12 seems to be one that can fill my reconstruction. But I'm not so geeky that you might be

  • on a Compaq Presario SR1426NX wireless mouse?

    I have a Compaq Presario SR1426NX I bought in 2005. I need to replace the mouse and I was wondering if I could use a mouse without a wire with this computer because it is so old. When I went to buy a mouse I noticed there were virtually no mouse with

  • Intermittent problem Realtek ethernet driver

    I have an office p6703w Pavilion with Windows 7hp, Realtek PCIe FE Family Controller.  Just got a new integrated modem/router to Comcast.  Wi - fi works very well on all devices.  Wired connection works fine on my laptop. Wired connection on the desk

  • HP Envy 5530 question about Online versus WiFi and access by HP for ink monitoring program

    Hello I am new here and also back to the program monthly fresh HPs for the programme of replacement of ink as well, I tried to find the answer to my question but could not.  Then... My question is, as I don't have a WiFi router (used for tv, netflix