Hello everybody.
I have a problem with a trigger which doesn't compile. The error is "PLS-00201: identifier 'USERS_LINK' must be declared"
USERS_LINK is a synonym for a table in another schema, accesed using a database link. I've tried to substitute it for the table@link directly, but I get the same error message.
Here is the code:
CREATE OR REPLACE TRIGGER aibak_fk
before insert or update on aibak
for each row
DECLARE
user varchar2(100);
fk EXCEPTION;
PRAGMA EXCEPTION_INIT(fk,-2291);
BEGIN
select nt_user into user from users_link where
nt_user = :new.owner_id;
select nt_user into user from users_link where
nt_user = :new.requester_id;
EXCEPTION WHEN NO_DATA_FOUND THEN
raise fk;
END;
/
I can execute the select statements separately, and it works fine.
Any ideas?
Thanks
I have a problem with a trigger which doesn't compile. The error is "PLS-00201: identifier 'USERS_LINK' must be declared"
USERS_LINK is a synonym for a table in another schema, accesed using a database link. I've tried to substitute it for the table@link directly, but I get the same error message.
Here is the code:
CREATE OR REPLACE TRIGGER aibak_fk
before insert or update on aibak
for each row
DECLARE
user varchar2(100);
fk EXCEPTION;
PRAGMA EXCEPTION_INIT(fk,-2291);
BEGIN
select nt_user into user from users_link where
nt_user = :new.owner_id;
select nt_user into user from users_link where
nt_user = :new.requester_id;
EXCEPTION WHEN NO_DATA_FOUND THEN
raise fk;
END;
/
I can execute the select statements separately, and it works fine.
Any ideas?
Thanks