I am able to call the function without any issues from SQL Developer as such
SELECT getOwnerDetails(22421).getClobVal() FROM dual;
The issue lies with calling the PL/SQL function from PHP via the query above. When I execute the query above via PHP I get:
Here’s my Function:
create or replace FUNCTION getOwnerDetailsAsXML( p_cursor IN sys_refcursor )
RETURN CLOB IS
v_clob CLOB;
v_ctx dbms_xmlgen.ctxhandle;
BEGIN
v_ctx := dbms_xmlgen.newcontext( p_cursor );
dbms_xmlgen.setnullhandling(v_ctx, 1);
v_clob := dbms_xmlgen.getxml(v_ctx);
dbms_xmlgen.closecontext(v_ctx);
RETURN v_clob;
END;
Uncaught exception: oci8 error: [22806: ORA-22806: not an object or REF] in EXECUTE(“SELECT getOwnerDetails(22421).getClobVal() FROM dual”)