Data360 Analyze

 View Only
  • 1.  Stored Proc with return Params?

    Posted 04-18-2023 15:33

    How can I call a stored proc that returns 2 parameters?

    create or replace PROCEDURE     XR_CREATE_MRC_OUTBOUND(
    OUTBOUNDBATCHID OUT NUMBER,
    TIMESTAMPCHAR OUT VARCHAR2)

    Thanks!!



    ------------------------------
    Geoff Geoff
    Windstream Communications
    Little Rock AR
    ------------------------------


  • 2.  RE: Stored Proc with return Params?

    Employee
    Posted 04-19-2023 10:05

    You can use the "JDBC Execute" node.



    ------------------------------
    Ernest Jones
    Precisely Software Inc.
    PEARL RIVER NY
    ------------------------------



  • 3.  RE: Stored Proc with return Params?

    Posted 04-19-2023 10:17

    got any examples?

    the sample only shows a create table and drop table...

    Thanks!



    ------------------------------
    Geoff Geoff
    Windstream Communications
    Little Rock AR
    ------------------------------



  • 4.  RE: Stored Proc with return Params?

    Employee
    Posted 04-19-2023 11:34

    Oh.  I just noticed where you asked , can RETURN 2 parameters.  I missed the word return.

    I do not know of a way to do that.  You can make a stored function instead, that maybe wraps the stored procedure and returns the two values inside a single value.

    CREATE FUNCTION my_function() RETURN VARCHAR2 IS
        OUTBOUNDBATCHID NUMBER;
        TIMESTAMPCHAR  VARCHAR2; 
    BEGIN
        XR_CREATE_MRC_OUTBOUND(OUTBOUNDBATCHID ,TIMESTAMPCHAR);
        RETURN OUTBOUNDBATCHID || ',' || TIMESTAMPCHAR;
    END;
    /
    Then call it using:
    SELECT my_function() FROM DUAL;

    (Warning, I don't know if my syntax is correct)



    ------------------------------
    Ernest Jones
    Precisely Software Inc.
    PEARL RIVER NY
    ------------------------------