Quantcast
Channel: Question and Answer » oracle
Viewing all articles
Browse latest Browse all 717

Calling a function in remote database inside a stored procedure

$
0
0

There are 2 Oracle databases with pseudo names Remote and Local. I have a function in Remote called FUS.F_Return_10 which simply returns 10 for testing purposes, where FUS is a schema name. In Local I want to create a procedure that will call the above function. Here’s the PL/SQL:

CREATE OR REPLACE PROCEDURE TEST
(
 V_COUNT OUT NUMBER
)
AS
 V_FOO NUMBER(2,0);
BEGIN
 V_FOO:= FUS.F_Return_10@PER_ACC;
  SELECT COUNT(*) INTO v_count FROM persons WHERE DEPID=V_FOO;
   EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_count :=0; 
END;

There’s a Public Database Link called PER_ACC in Local. When I try to create this procedure I get: Encountered symbol “@” when expecting one of the following: .(*%&…………….

I’m executing this code in SQL Developer

Can you tell me where my mistake is?


Viewing all articles
Browse latest Browse all 717

Trending Articles