Hello I have written some stored procedures that use logic to lookup schema and dblinks based on whatever environment they are compiled in, because these are not consistent across all environments I am working in. This way I only have to have the functions maintenanced to set to return the correct data.
v_ENV := f_get_schema ('SC1');
v_LINK := f_get_dblink ('DB1');
'DELETE FROM mytable1
WHERE mem_type = ''PH''
AND ID IN ( select id from '
|| ' )';
This was working fine until I had to change a cursor in the procedure. Is there a way to pass a schema and link to a procedure? I have done this with variables but never with these components, so I am a bit stumped.Any ideas so I can get rid of the hardcoded schema and link name? Otherwise the original effort above is diminished.
WHERE id LIKE 'XXX%';