create a function that receives a dblink as parameter
I need a function that returns the name of a datafile that is in any instance of my environment.
The function would be:
CREATE OR REPLACE FUNCTION f_data_file (v_file_id NUMBER, v_sid varchar)
RETURN VARCHAR2 is v_file_name VARCHAR2 (256);
BEGIN
SELECT file_name
INTO v_file_name
FROM sys.dba_data_files@v_sid
WHERE file_id = v_file_id;
return v_file_name;
END f_data_file;
But when compile I receive the errors:
ORA-04052: error occurred when looking up remote object SYS.DBA_DATA_FILES@V_SID
ORA-00604: error occurred at recursive SQL level 1
0