I'm trying to bind date parameters to stored procedure. $conn is ok, all parameters are correct. I have no problem with calling this procedure in the db directly. I tried to print error, but I don't get anything. I'm not attaching exec_cur now cause I guess, that the problem is in binding or calling the procedure. I have also tried to quote i_start and i_end:
TO_DATE(':i_start', 'DD.MM.YYYY'), TO_DATE( ':i_end', 'DD.MM.YYYY')
It seems to me, that the call doesn't get the result.I'm getting empty cursor while calling it from the code . While calling it directly, I'm getting many entries.
Here the function:
function &HST($conn, $i_qot_id, $i_startend, $i_order_by, $i_max_rows, $v_cache_filename)
{
$outrefc = oci_new_cursor($conn);
$oerr = OCIError( $outrefc);
echo "Fetch Code 1:".$oerr["message"];
$mycursor = oci_parse($conn, "begin PPCKG.HST (:i_qot_id, TO_DATE(:i_start, 'DD.MM.YYYY'), TO_DATE( :i_end, 'DD.MM.YYYY') , :i_order_by, :i_max_rows, :curs); end");
print $i_startend[0].$i_startend[1].$i_qot_id. $i_order_by. $i_max_rows;
$oerr = OCIError( $mycursor);
echo "Fetch Code 1:".$oerr["message"];
oci_bind_by_name($mycursor, ':i_qot_id' , $i_qot_id);
oci_bind_by_name($mycursor, ':i_start' , $i_startend[0]);
oci_bind_by_name($mycursor, ':i_end' , $i_startend[1]);
oci_bind_by_name($mycursor, ':i_order_by', $i_order_by);
oci_bind_by_name($mycursor, ':i_max_rows', $i_max_rows);
oci_bind_by_name($mycursor, ':curs' , $outrefc, -1, OCI_B_CURSOR);
$oerr = OCIError( $mycursor);
echo "Fetch Code 1:".$oerr["message"];
return exec_cur( $mycursor, $outrefc, $v_cache_filename);
}