Skip to Main Content

Oracle Database Discussions

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!

Having problems with a trigger that updates data in a postgres database

604042Dec 27 2007 — edited Jan 3 2008
Errors I am seeing:

ORA-00980: synonym translation is no longer valid
ORA-00942: table or view does not exist

Code:

CREATE OR REPLACE TRIGGER "test"
BEFORE DELETE OR INSERT OR UPDATE ON LOCAL_ORACLE_TEMP_TABLE FOR EACH ROW
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
IF :new.FIRST_NAME != :old.FIRST_NAME THEN
UPDATE "remotetable"@databaselink SET fname = :new.FIRST_NAME WHERE USERNAME = :old.PIDM;
END IF;
COMMIT;
END test;
/

If I change the UPDATE statment to work on a table local to the oracle database then it compiles just fine. But that is not what I need. The purpose is to propagate changes accross to the postgreSQL database when changes are made to the data in the oracle database.

In the UPDATE statement above, if I use the synonym for the remote postgreSQL table it gives me the first oracle error, ORA-00980. I can select rows from the table using that synonym just fine outside of the trigger.

In the UPDATE statement above, if I use the tablename@linkname (which is what is shown above) it gives me the second oracle error, ORA-0942. Once again, I can select rows from this table using the database link just fine outside of the trigger.

What gives? This is very annoying. Nothing has came easy using Oracle lately, it has been extremely frustrating dealing with problems like this that make no sense. Any help is greatly appreciated. The sooner the better, this is a time sensitive project!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 31 2008
Added on Dec 27 2007
3 comments
1,741 views