Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling a function in remote database inside a stored procedure

MikailApr 9 2013 — edited Apr 9 2013
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: .(*%&................

Can you tell me where my mistake is?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2013
Added on Apr 9 2013
7 comments
970 views