Stored Procedure - How to read ARRAY OUT parameter

From: Ahmad Ruswandi (ayuliant..lb.com)
Date: Mon Oct 04 2004 - 04:09:59 EDT

  • Next message: Gentry, Michael: "RE: Unique fields"

    Dear all,

    I'm trying to use Cayenne to call stored procedure in Oracle.

    I have the following stored procedure, where I have out parameter "out1"
    with type varchar2 (equivalent to String() in java).
    -----------------------------------------------------------
    procedure PROC1(test_type varchar2, out1 out varchar2) is
    begin
    out1 := 'aaa';
    end;
    -----------------------------------------------------------

    I call procedure PROC1 sucessfully using code below:
    -----------------------------------------------------------
    ProcedureQuery query = new ProcedureQuery("PROC1");
    query.addParameter("test_type", "ANY TEST");
    query.addParameter("out1", new String());

    QueryResult resultsCollection = new QueryResult();
    context.performQuery(query, resultsCollection);
    ...
    ...
    -----------------------------------------------------------

    Now, I would like to have a procedure like this:
    -----------------------------------------------------------
    TYPE EmpTabTyp is table of varchar2(30);
    /

    CREATE OR REPLACE
    procedure PROC2(test_type varchar2, out1 out varchar2,
                             out2 out EmpTabTyp) is

        emp_tab EmpTabTyp;

    begin -- main

        SELECT 'Ahmad' INTO emp_tab(1) FROM dual ;
        SELECT 'Ruswandi' INTO emp_tab(2) FROM dual ;

    out1 := 'aaa';
    out2 := emp_tab;
    end;
    /
    -----------------------------------------------------------

    How to access out parameter "out2" that has a list of value. What is the
    equivalent type in Java/cayenne?

    regards,

    ahmad



    This archive was generated by hypermail 2.0.0 : Mon Oct 04 2004 - 04:27:16 EDT