Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Dynamic cursor ?
Hi,
I need to declare a cursor that selects from a table via database link but I don't know the name of the link before I select it from another table. How do I declare the cursor ? Can I use dynamic sql ?
set serveroutput on
DECLARE
db_link_name VARCHAR2(50);
CURSOR cur1 IS SELECT col1 FROM table1_at_db_link_name;
BEGIN
FOR cur IN cur1 LOOP ... END LOOP;
Regards,
Maija-Leena Received on Tue Jul 03 2007 - 01:57:21 CDT