This content has been marked as final. Show 2 replies
In that case, you didn't populate the OUT refcursor.
So if the calling environment tries to use it, it's not valid.
In such a case you probably want something like:
This way, the cursor is opened regardless, but if A_ID does not equal 1 then the cursor will return no rows.
Procedure p_example ( A_ID IN NUMBER, A_Number IN Vacrhar2, po_cur_error_msg OUT REFCURSOR) IS begin lv_vc_success_msg error_message := "Success" OPEN po_cur_error_msg FOR SELECT lv_vc_success_msg error_message, '00' ERROR_CODE, 0 flag FROM DUAL WHERE A_ID=1; exception <Exception Block> END p_example;