-
Dd link parameter
I'm trying to pass in the first part of a db link with a parameter in a procedure but cant seem to get the syntax right - can anyone please help?
Code:
PROCEDURE INVALID_OBJECTS1 (p_dbsid varchar)
IS
cursor c_total_inv_obj is
select owner,object_name, object_type
from dba_objects@p_dbsid||'.world'
where status = 'INVALID'
and object_type in ('PACKAGE BODY','PACKAGE','FUNCTION',
'PROCEDURE','TRIGGER','VIEW','QUEUE');
-
you can't do it throught straight pl/sql like that. You have to use dynamic sql.
-
As Jeff mentioned use execute immediate
v_sql = 'select .... oracle' + '.world'
execute immediate(v_sql)
-
You should take a look at ref cursors.