Executing stored procedures through database links

Executing stored procedures through database links

 

  

Does anyone know how to execute stored procedures through database links?

I have two db schemas in two separate Oracle instances:

I have db_schema_A created on instance_A, which is running on physical box
A and
I have db_schema_B created on instance_B, which is running on physical box
B.

I created a database link db_link_B in db_schema_A, which points to
db_schema_B on the other physical box.

From a package_A stored in db_schema_A, I am trying to execute a PL/SQL
stored procedure stored in a package_B in db_schema_B.

I tried the following without success (I cannot even compile):

PROCEDURE proc_A
IS
ret_val INTEGER;
BEGIN

ret_val := db_link_B.package_B.func_B('A message'); -- DOES NOT
WORK

ret_val := package_B.func_B('A message')@db_link_B; -- DOES NOT WORK

dbms_output.put_line('The return value is: ' || to_char(ret_val);

END proc_A;

Does anyone know if this is possible? If so, what is the syntax?

The error I keep getting is : PLS-00201: identifier 'db_link_B' must
be declared

I know my db link works because I can successfully do this: Select *
from [Email Address Removed] help will be appreciated, thank you.

Esteban






Oracle LazyDBA home page