PLSQL - Creating a cursor for a table that does not exist
I am writing my first PLSQL program, and I have run into a problem creating a cursor.
I have a cursor that accesses a table on another database via a database link. The database link does not yet exist, so the first thing that my PLSQL does is create the database link. The problem is that I have to define my cursor before I have executed the code for the database link, and the compiler gives me an error for referring to a table that does not yet exist. How can I get around this?
Here is the basic structure of my program
DECLARE
--cursor defined here
BEGIN
--code creates database link if it does not yet exist
--code executes cursor
END