I'm able to call a PL/SQL procedure and package over a real database link fine, but cannot seem to do so over a loopback database link (a database link referring to a schema in the same database, used for testing purposes), in two different databases.
Is there a trick that is required in order to execute remote plsql packages/procedures/functions over a loopback database link?
Local database (foo):
CREATE DATABASE LINK MATTHEW@INST1 CONNECT TO bar IDENTIFIED BY password USING 'MATTHEW';
-- this works fine, as well as selecting from other tables
SELECT * FROM dual@MATTHEW@INST1;
Remote database (bar schema):
create package test_pkg is PROCEDURE test_proc; end; / create package body test_pkg is procedure test_proc is begin dbms_output.put_line('hello'); end; end; / create procedure test_proc is begin dbms_output.put_line('hello'); end; / create or replace function ff return number is begin return 55; end; /
Local database (foo)
BEGIN
test_proc@MATTHEW@INST1;
END;
/
Error report: ORA-06550: line 2, column 5: PLS-00201: identifier 'TEST_PROC@MATTHEW@INST1' must be declared
BEGIN
test_pkg.test_proc@MATTHEW@INST1;
END;
/
Error report: ORA-06550: line 2, column 5: PLS-00201: identifier 'TEST_PKG.TEST_PROC@MATTHEW@INST1' must be declared
select ff@MATTHEW@INST1 from dual;
ORA-00904: "FF": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action: