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!

Cursor with IN paramater in WHERE clause?

537177Dec 5 2007 — edited Dec 5 2007
Hi ,

I am running 9i and trying to define a cursor, which would have an IN parameter as table name.
I can use the parameter in WHERE clause LIKE name= in_parameter,
But this time I need it in FROM clause :-(
I guess this is not working, or is there any way around?

DBLINK_SOURCE CONSTANT VARCHAR2(30) DEFAULT 'LINK_NAME_1';
DBLINK_TARGET CONSTANT VARCHAR2(30) DEFAULT 'LINK_NAME_2';

TABLE_NAME_SOURCE VARCHAR2(60) DEFAULT 'MY_TABLE@' || DBLINK_SOURCE;
TABLE_NAME_TARGET VARCHAR2(60) DEFAULT 'MY_TABLE@' || DBLINK_TARGET;

v_table_name VARCHAR2(60);

-- Global cursors
CURSOR relevant_entity_cur
(v_table_name IN VARCHAR2) IS
SELECT DISTINCT(table_name)
FROM v_table_name;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 2 2008
Added on Dec 5 2007
2 comments
256 views