Cursor with IN paramater in WHERE clause?
537177Dec 5 2007 — edited Dec 5 2007Hi ,
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;