How to execute the packaged procedure(having out param) in TOAD for Oracle

Hi.
Could you help me
How to execute the packaged procedure having out parameters in TOAD for Oralce..
Thanks..

Use anonymous PL/SQL block to execute it.
Example.
DECLARE
  <out variable name> <out variable data type>;
BEGIN
  <package name>.<procedure name>(<out variable name>);
END;

Similar Messages

  • How to execute the packaged procedure

    Hello i've written the following package: It's created fine but while running that procedure i'm getting the following error
    create or replace package ttt_example as
      TYPE ColumnsInfo IS RECORD (
          columnName VARCHAR2 (30),
          dataType VARCHAR2 (30)
    TYPE ColumnsInfoList IS TABLE OF ColumnsInfo; 
    FUNCTION getColumns (
          schemaName VARCHAR2,
          tableName VARCHAR2
          RETURN ColumnsInfoList;
    PROCEDURE fillTable (
          schemaName VARCHAR2,
          tableName VARCHAR2
    end;
    create or replace package body ttt_example is
    PROCEDURE fillTable (
          schemaName VARCHAR2,
          tableName VARCHAR2
       ) IS
          i NUMBER;
          columnsList ColumnsInfoList;
          columnsStr VARCHAR2 (4000);
          valList VARCHAR2 (4000) := NULL;
          insertTime VARCHAR2 (100);
       BEGIN
          DBMS_OUTPUT.PUT_LINE ('fillTable - BEGIN');
          columnsList := getColumns (schemaName, tableName);
          i := columnsList.FIRST;
          IF i IS NOT NULL THEN
             columnsStr := columnsList (i).columnName;
             i := columnsList.NEXT (i);
          END IF;
          WHILE i IS NOT NULL LOOP
             columnsStr := columnsStr || ', ' || columnsList (i).columnName;
             i := columnsList.NEXT (i);
          END LOOP;
          i := columnsList.FIRST;
          WHILE i IS NOT NULL LOOP
             IF i != columnsList.LAST THEN
                IF columnsList (i).dataType = 'NUMBER' THEN
                   valList := valList || i || ', ';
                ELSIF columnsList (i).dataType = 'VARCHAR2' THEN
                   valList := valList || '''' || i || '''' || ', ';
                ELSIF columnsList (i).dataType = 'DATE' THEN
                   --EXECUTE IMMEDIATE 'SELECT TO_CHAR(SYSTIMESTAMP) FROM dual' INTO insertTime;
                   --valList := valList ||''''|| insertTime||''''|| ', ';
                   valList := valList || 'SYSDATE, ';
                ELSE
                   DBMS_OUTPUT.PUT_LINE ('WRONG DATA TYPE ' || columnsList (i).dataType);
                END IF;
             ELSE
                IF columnsList (i).dataType = 'NUMBER' THEN
                   valList := valList || i;
                ELSIF columnsList (i).dataType = 'VARCHAR2' THEN
                   valList := valList || '''' || i || '''';
                ELSIF columnsList (i).dataType = 'DATE' THEN
                   --EXECUTE IMMEDIATE 'SELECT TO_CHAR(SYSTIMESTAMP) FROM dual' INTO insertTime;
                   --valList := valList ||''''|| insertTime||'''';
                   valList := valList || 'SYSDATE';
                ELSE
                   DBMS_OUTPUT.PUT_LINE ('WRONG DATA TYPE ' || columnsList (i).dataType);
                END IF;
             END IF;
             i := columnsList.NEXT (i);
          END LOOP;
          DBMS_OUTPUT.PUT_LINE ('fillTable - MIDDLE');
          EXECUTE IMMEDIATE 'INSERT INTO ' || tableName || '(' || columnsStr || ') VALUES (' || valList || ')';
          DBMS_OUTPUT.PUT_LINE ('fillTable - END');
       END;
    FUNCTION getColumns (
          schemaName VARCHAR2,
          tableName VARCHAR2
          RETURN ColumnsInfoList IS
          columnsList ColumnsInfoList;
       BEGIN
          DBMS_OUTPUT.PUT_LINE ('getColumns - BEGIN');
          EXECUTE IMMEDIATE 'SELECT COLUMN_NAME, DATA_TYPE FROM ALL_TAB_COLUMNS WHERE OWNER = ''' || schemaName || ''' AND TABLE_NAME = ''' || tableName || ''''
          BULK COLLECT INTO columnsList;
          DBMS_OUTPUT.PUT_LINE ('getColumns - END');
          RETURN columnsList;
       EXCEPTION
          WHEN OTHERS THEN
                      RAISE;
       END;
    end;
    /  While executing that package procedure
    SQL> begin
      2  ttt_example.fillTable('TEST','EMPE');
      3  end;
      4  /
    begin
    ERROR at line 1:
    ORA-00928: missing SELECT keyword
    ORA-06512: at "ttt.TTT_EXAMPLE", line 60
    ORA-06512: at line 2help me in this

    I was able to reproduce with NULL for columnstr;
    create table t (c1 varchar2(20), c2 varchar2(20));
    Table created
    create or replace procedure p
      tablename  varchar2,
      columnsstr varchar2,
      vallist    varchar2
    ) is
    begin
      execute immediate 'INSERT INTO ' || tablename || '(' || columnsstr ||
                        ') VALUES (' || vallist || ')';
    end;
    Procedure created
    exec p('t', 'c1,c2', '''a'',''b''');
    PL/SQL procedure successfully completed
    select * from t;
    C1                   C2
    a                    b
    exec p('t', '', '''a'',''b''');
    begin p('t', '', '''a'',''b'''); end;
    ORA-00928: missing SELECT keyword
    ORA-06512: at "MSCALLION.P", line 8
    ORA-06512: at line 2

  • How to execute the package generated from Warehousebuilder ??

    Hi,
    I am very new to OWB, i have created the mapping and i want to write a oracle job to run the mapping, Can i explicitly execute the Package generated by passing the parameters required,
    I have actually created like following,
    DECLARE
    p_status VARCHAR2 (200);
    p_deptno NUMBER;
    p_max_no_of_errors VARCHAR2 (200);
    p_commit_frequency VARCHAR2 (200);
    p_operating_mode VARCHAR2 (200);
    p_bulk_size VARCHAR2 (200);
    p_audit_level VARCHAR2 (200);
    p_purge_group VARCHAR2 (200);
    BEGIN
    p_deptno := 10;
    p_max_no_of_errors := NULL;
    p_commit_frequency := NULL;
    p_operating_mode := NULL;
    p_bulk_size := NULL;
    p_audit_level := NULL;
    p_purge_group := NULL;
    map_filter_parameter.main (p_status => p_status,
    p_deptno => p_deptno,
    p_max_no_of_errors => p_max_no_of_errors,
    p_commit_frequency => p_commit_frequency,
    p_operating_mode => p_operating_mode,
    p_bulk_size => p_bulk_size,
    p_audit_level => p_audit_level,
    p_purge_group => p_purge_group
    DBMS_OUTPUT.put_line ('P_STATUS = ' || p_status);
    END;
    I am actually following error,
    Line: ----
    Connecting to the database bl.
    ORA-20013: The workspace has not been set. Please call wb_workspace_management.set_workspace procedure to set workspace first.
    ORA-06512: at "OWBSYS.WB_WORKSPACE_MANAGEMENT", line 1356
    ORA-06512: at "OWBSYS.WB_WORKSPACE_MANAGEMENT", line 1387
    ORA-06512: at "OWBSYS.WB_RTI_UTIL", line 102
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1020
    ORA-06512: at "BL.MAP_FILTER_PARAMETER", line 2798
    ORA-06512: at line 19
    Process exited.
    Disconnecting from the database bl.
    I am not able to connect OWBSYS to see whats going on with OWBSYS.WB_WORKSPACE_MANAGEMENT as well.
    Please suggest
    Regards,
    Ashoka BL

    Hi Nawneet,
    I tried like the following and getting the results,I searched in the forum to do this,
    DECLARE
    p_status VARCHAR2 (200);
    p_deptno NUMBER;
    p_max_no_of_errors VARCHAR2 (200);
    p_commit_frequency VARCHAR2 (200);
    p_operating_mode VARCHAR2 (200);
    p_bulk_size VARCHAR2 (200);
    p_audit_level VARCHAR2 (200);
    p_purge_group VARCHAR2 (200);
    BEGIN
    p_deptno := 20;
    p_max_no_of_errors := NULL;
    p_commit_frequency := NULL;
    p_operating_mode := NULL;
    p_bulk_size := NULL;
    p_audit_level := NULL;
    p_purge_group := NULL;
    owbsys.wb_workspace_management.set_workspace('ASHOK_WORKSPACE','ASHOK_BL');
    map_filter_parameter.main (p_status => p_status,
    p_deptno => p_deptno,
    p_max_no_of_errors => p_max_no_of_errors,
    p_commit_frequency => p_commit_frequency,
    p_operating_mode => p_operating_mode,
    p_bulk_size => p_bulk_size,
    p_audit_level => p_audit_level,
    p_purge_group => p_purge_group
    DBMS_OUTPUT.put_line ('P_STATUS = ' || p_status);
    END;
    Do you please let me know what are these,
    'PLSQLMAP','CUSTOMER_MAP' == WorkSpace_Name and User_Name ??
    Regards,
    Ashoka BL
    Edited by: user7348859 on May 26, 2009 5:07 AM

  • How to see the packaged procedures in form builder?

    Hi Experts,
    I have a oarcle apps form in form builder.
    When i want to see the code behind the trigger when pressed button do ,i see that it calls a packaged procedure like
    oksaudet_header.when_button_pressed(p_item => 'STOP_BUTTON');
    I want to see beyond this ,so how to find out this package procedure oksaudet_header.when_button_pressed?
    if its any pll ,how do i know which pll will have this package?
    Thanks

    Hi,
    You just need to search for component OKSAUDET_HEADER in Forms Builder (use the 'Find' button). It will take you to the package, and above it you will find the attached library that contains it (if it's an attached library).
    Hope it helps.

  • How to execute the package in odi

    hi
    i have a 3 interfaces.i have to put it in package and execute this package.but problem is that it is executing in a infinite loop.
    so how to execute these 3 interfaces serielly in package.(without in a loop)

    If you want to execute your 3 interfaces one by one you just have to define a First Step (Right click "First Step")
    And then to link the first interface with the second one with the Green arrow, and the 2nd one with the third with another green arrow...
    If after that you link the 3rd with the first it will loop...
    So avoid this.
    Regards,
    Brice

  • Can not able to save the data while executing the package/procedure

    Hi,
    I created one package and schedule this in JOB, job is running successfully but data is not inserting in table,
    CREATE OR REPLACE package body LST_RPT as
    procedure gender_proc(gender varchar2) is
    begin
    insert into gender_count
    select * from mag_hotline_gender;
    end;
    end LST_RPT;
    after that I am executing this
    exec MSREUL.MKE_LST_RPT.gender_proc('M');
    but it is not saving the data
    can anybody suggest where I am doiing mistake

    Hi Arun,
    Thanks for the suggestion.
    I checked my table structure, gender_count was GTT(global temporary table), Now I changed the structure package is executing sucessfully and able to commit the data
    exec MKE_LST_RPT.gender_proc('M');
    commit;
    can you plz help on another point I want to schedule this package on job means it runs on every day and commit automatically, I am using TOAD but unable to create job can you plz help on this issue.

  • How to execute dynamically created procedure with out parameter

    hi guys ,
    friend i have to execute a procedure whose name is going to change dynamically and this procedure is have 2 out parameter . I need to capture value of these 2 output parameter, here i m giving my code also ..
    declare
    v_emp_id int :=100013 ;
    p_reg_off varchar(5) := 'R' ;
    p_user_id int := 6 ;
    v_status varchar(200);
    v_message varchar (200);
    v_Formula varchar(100);
    v_number int := 1 ;
    begin
    v_Formula := 'Call testsp_'||v_number||'('||v_emp_id||','''||p_reg_off||''','|| p_user_id || ',v_status,v_message)' ;
    DBMS_OUTPUT.PUT_LINE( v_Formula);
    execute immediate v_Formula;
    end ;
    and my procedure structure is like this
    CREATE OR REPLACE PROCEDURE testsp_1
    p_emp_id INT,
    p_reg_off CHAR,
    p_user_id INT,
    p_status OUT NOCOPY INT,
    p_message OUT NOCOPY VARCHAR2
    AS
    begin
    end ;
    please help me .....

    The Complete Syntax for Execute Immediate is ::
    EXECUTE IMMEDIATE dynamic_sql_string
    [INTO {define_variable,... | INTO record_name}]
    [USING
    IN bind_argument,...]
    [RETURN[ING] INTO
    bind_argument,...];
    i think now it won't be a problem! ;)

  • How to Execute a Stored Procedure having cursor?

    Hi Experts,
    I'm a Newbie in Oracle can please help me on creating a execution script for the following SP.
    create or replace
    PROCEDURE TestListsGet
      v_Mkt IN CHAR DEFAULT NULL ,
      cv_1 IN OUT SYS_REFCURSOR
    AS
    BEGIN
       OPEN cv_1 FOR
          SELECT NAME,
                LIT,
                LiInfo,
                DisplayOrder
            FROM ListsGET
           WHERE Mkt = v_Mkt
            ORDER BY DisplayOrder;
    END;Regards,
    --Eswin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    There are many constructs you would have to read up on in the PL/SQL guide.
    Where do you plan to call the procedure from?
    The following uses SQL Plus
    set serveroutput on
    declare
      r sys_refcursor;
      v_name          ListsGet.Name%type;
      v_Lit           ListsGet.Lit%type;
      v_LiInfo        ListsGet.LiInfo%type;
      v_DisplayOrder  ListGet.DisplayOrder%type;
    begin
    TestListGet (v_Mkt => null, cv_1 => r);
    loop
       fetch r into v_name, v_Lit, v_LiInfo, v_DisplayOrder;
       exit when r%notfound;
        dbms_output.put_line('Name          : ' || v_Name);
        dbms_output.put_line('Lit           : ' || v_Lit);
        dbms_output.put_line('LiInfo        : ' || v_LiInfo);
        dbms_output.put_line('Display Order : ' || v_DisplayOrder);
      end loop;
      close r;
    end;
    /

  • How to call the stored procedure in side the package... ?

    Hi
    I have one package i am new to PL/SQL. I want to execute the package and procedure.
    CREATE OR REPLACE PACKAGE BODY Employee_pkg
    AS
    PROCEDURE GetEmployeeName(i_empno IN NUMBER,
    o_ename OUT VARCHAR2)
    IS
    BEGIN
    SELECT ename
    INTO o_ename
    FROM emp
    WHERE empno = i_empno;
    END GetEmployeeName;
    END Employee_pkg;
    Please tell me how to execute the package. and inside procedure
    Thanks

    SQL> create package employee_pkg
      2  as
      3    procedure getemployeename(i_empno in number, o_ename out varchar2);
      4  end employee_pkg;
      5  /
    Package is aangemaakt.
    SQL> CREATE OR REPLACE PACKAGE BODY Employee_pkg
      2  AS
      3  PROCEDURE GetEmployeeName(i_empno IN NUMBER,
      4  o_ename OUT VARCHAR2)
      5  IS
      6  BEGIN
      7  SELECT ename
      8  INTO o_ename
      9  FROM emp
    10  WHERE empno = i_empno;
    11  END GetEmployeeName;
    12
    13
    14  END Employee_pkg;
    15  /
    Package-body is aangemaakt.
    SQL> var P_ENAME varchar2(30)
    SQL> set autoprint on
    SQL> exec employee_pkg.getemployeename(7839,:P_ENAME)
    PL/SQL-procedure is geslaagd.
    P_ENAME
    KINGRegards,
    Rob.

  • Error with Project Parameters when executing the package with dtexec command

    Hi,
    We have started migrating our SSIS package from 2005 version to SSIS 2012. In SSIS 2005 we were using XML configuration files and executing the packages with dtexec command from the packages folder (without deploying packages to filesystem).
    Now in SSIS 2012, we have seen Project Parameters and created couple of package parameters and used those parameters in the package. when executing this package from solution explorer it was working fine but when i try to execute the same package from command
    line with Dtexec command, it was showing an error message of 'Not able to map Project Prameters to configurations'.
    Could you please give me an idea of how to execute the packages from command line by using dtexex command. basically i would like use project parameters in 2012 similar to configurations?
    Thanks,
    Venu.

    Refer
    http://msdn.microsoft.com/en-IN/library/hh231187.aspx
    you can pass parameter like this
    /SET \Package.Variables[$Package::ParameterName];<value> /SET \Package.Variables[$Project::ParameterName];<value>
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to Execute the procedure?

    Hi,
    How to execute a below procedure with refcursor output parameter,
    in that procedure refcursor declare in package
    create or replace PROCEDURE prc_sam(
    P_LIST OUT pkg_sam.REF_CURSOR_TYPE) IS
    BEGIN
    OPEN P_LIST FOR
    SELECT 1+1 FROM dual;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20001,SQLERRM);
    END prc_sam;
    Regards,
    Fame

    SQL> create or replace PROCEDURE prc_sam(
    2 P_LIST OUT SYS_REFCURSOR) IS
    3 BEGIN
    4
    5 OPEN P_LIST FOR
    6 SELECT 1+1 FROM dual;
    7 EXCEPTION
    8 WHEN OTHERS THEN
    9 RAISE_APPLICATION_ERROR(-20001,SQLERRM);
    10 END prc_sam;
    11 /
    Procedure created.
    SQL> VARIABLE P_CURSOR REFCURSOR;
    SQL> EXEC prc_sam(:P_CURSOR);
    PL/SQL procedure successfully completed.
    SQL> PRINT P_CURSOR;
    1+1
    2
    Intead of SYS_REFCURSOR, you can use ur pkg_sam.REF_CURSOR_TYPE inside a package
    AND
    execute a procedure like EXEC pkg_sam.prc_sam(:P_CURSOR);
    like this, then you will get the result............................
    Thanks,
    Ann

  • How to execute the parametered stored procedure in sql *plus ?

    how to execute the parametered stored procedure in sql *plus ?
    my storedprocedure format
    CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE
    (empDOB out date, empEmpName out varchar2)
    thanks & regards
    mk_mur

    Oh, sorry... making many reading-too-fast mistakes today...
    You can't declare date variables in SQL*Plus (seel help var), but you can cast to varchar2:
    TEST> CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE (empDOB out date, empEmpName out varchar2) IS
      2  d date := sysdate;
      3  e varchar2(10) := 'bob';
      4  begin
      5  empdob := d;
      6  empempname := e;
      7  end;
      8  /
    Procedure created.
    TEST> var d varchar2(30)
    TEST> var n varchar2(30)
    TEST> call  SMS_SELECTMPLOYEE(:d,:n);
    Call completed.
    TEST> print d n
    D
    11/07/06
    N
    bobYoann.

  • How to Execute SSIS package through MySQL Procedure

    Hi Everyone,
    How to Execute SSIS package from MySQL Stored Procedure.
    Please share your suggestions on this.
    Regards,
    Vaishu

    I am not sure whether you have SSIS license version installed in the system where MYSQL is there. In order to run SSIS package we need to have DTEXEC executable file and it comes with SSIS license version.
    An SSIS package can be executed from command prompt as,
    C:\>dtexec /f E:\package.dtsx
    I am not expert in MYSQL however in TSQL we can run dos command or scripting language such as vbscript.
    Similarly you need to check in MYSQL. This is MSSQL Server forum.
    Refer
    http://www.ehow.com/how_8789576_call-ssis-package-vbscript.html
    http://www.mssqltips.com/sqlservertip/1775/different-ways-to-execute-a-sql-server-ssis-package/
    Regards, RSingh

  • How to execute the procedure in sap b1

    Hai to all,
                 I done a procedure in sql server .but i don't know how to execute that  procedure in sap b1?
    can anyone help me immediately.
    Regards,
    Ramya.S

    Dear Ramya.S,
    You could execute the store procedure by using Recordset object in SDK DI code. It is like:
    Dim myRecordSet As SAPbobsCOM.Recordset
    myRecordSet =                                   
    SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecord
    set)
    myRecordSet.Command.Name = "TestStoredProcedure"
    myRecordSet.Command.Parameters.Item("@ItemLike").Value = "IT%"
    myRecordSet.Command.Parameters.Item(2).Value = "C0001"
    myRecordSet.Command.Execute()

  • How to use ADO(Microsoft ActiveX Data Objective 2.8 Library) to execute the store procedure of database in SQL server

    how to use ADO(Microsoft ActiveX Data Objective 2.8 Library) to execute the store procedure of database in SQL server?
    Does any body can tell me about this?
    thanks
    [email protected]

    Hi 
    Did you succeed to execute the procedure?
    How ?
    Thanks
    Shimon Zerbib

Maybe you are looking for