How to output result of SELECT statement which is executed using native dynamic SQL?

If you are on Oracle 12c with a 12c client, this should work:

declare
    rc sys_refcursor;
begin
    open rc for 'select * from dual';
    dbms_sql.return_result(rc);
end;

Leave a Comment