9 Replies Latest reply on Sep 29, 2017 11:15 PM by Vadim Tropashko-Oracle

    Executing packages with refcursor output

    f67d28d7-600d-47a2-aef1-57ca83153834

      I have a package that contains a procedure that has a refcursor output. It is a very basic package that we are using to test functionality in python using cx_oracle to execute it. When I try to test this package in Oracle SQL Developer to make sure I have a working test case for our developer, it occasionally works, but often fails with different errors.

       

      This is the code I am using to execute the package and this code is based on code I've seen all over the internet as a standard call to this type of package:

       

      variable rc refcursor;

      EXEC PKG_TEST_REFCURSOR2.USP_GEN_TBL_RESULTS(:rc);

      print rc;

       

      This code either works as expected or it generates this error:

      not all variables are bound

       

      OR it just prints the variable name RC.

       

      Can someone direct me on what might be going on here? I have also tried alternately: set serveroutput on; before running the above code and that doesn't seem to make a difference. I've also tried using both EXEC and CALL with the same results.