7 Replies Latest reply on Aug 2, 2020 4:50 PM by Emu

    cannot execute cursor with nested cursor through ords

    Emu

      I have a cursor that contains a cursor as in the example below:

      DECLARE

        c sys_refcursor;

      BEGIN

      open c for select deptno,                   

                                dname,                    

                               cursor(select empno,                                 

                                                         ename                            

                                                          from emp e

                                                       where e.deptno=d.deptno) emps             

                      from dept d; 

      apex_json.open_object;   a

      pex_json. write('departments', c);  

      apex_json.close_object;

       

      If I write this output to a clob it works fine.  If I remove the inner cursor it works fine over ORDS.

       

      However with the inner cursor if I try to write it over ORDS...I get an indecipherable:

      555 User Defined Resource Error
      Does anyone have any ideas what might be happening here?

      (Using autonomous database : Version 19c, ORDS: 19)