Oracle PLSQL - Declare a cursor on a non-existing table
You should be able to define your cursor like this:
DECLARE c SYS_REFCURSOR;BEGIN OPEN c FOR 'SELECT * FROM dual'; CLOSE c;END;
You can also bind arguments:
OPEN c FOR 'SELECT * FROM dual WHERE DUMMY = :1' USING 'X';
For further information see the Oracle documentation of the OPEN-FOR Statement.
Example using a stored procedure
CREATE OR REPLACE PROCEDURE test IS c SYS_REFCURSOR;BEGIN OPEN c FOR 'SELECT * FROM fdfdfdfdfd'; CLOSE c;END;/