Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLSQL - Creating a cursor for a table that does not exist

User527096-OracleJul 12 2007 — edited Jul 13 2007
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 10 2007
Added on Jul 12 2007
10 comments
847 views