I can't execute the stored procedure from the function. Here is what I try:

function STD( $i_std_id, $i_order_by   )
{

        $conn = open_db("CONN");
        $outrefc  = oci_new_cursor($conn); //Declare cursor variable
        $mycursor = oci_parse ($conn, "begin  TEST.STD( :i_std_id, :i_order_by, :curs); end;"); // prepare procedure call

        oci_bind_by_name($mycursor,':i_std_id'  , $i_std_id   );
        oci_bind_by_name($mycursor,':i_order_by', $i_order_by );
        oci_bind_by_name($mycursor,':curs'      , $outrefc, -1, OCI_B_CURSOR); // bind procedure parameters


        return exec_cur($conn, $mycursor, $outrefc);

}

Connection is ok. Anyhow I get no result. I'm expecting more rows.

I can print the parameters with echo $i_order_by."#### $i_std_id". When I run the procedure directly in DB with the printed parameters, I get the output.

Here is the signature:

PROCEDURE STD
(
    i_std_id     IN NUMBER,
    i_qot_id     IN NUMBER,
    i_order_by   IN VARCHAR,
    o_recordset  OUT SYS_REFCURSOR
);

Any clue? Thank you.

有帮助吗?

解决方案

Isn't there a problem with the parameters ? I can see you call procedure STD with 3 parameters, whereas you mention 4 in its signature (i_qot_id seems to be the extra one).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top