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!

1st SchemaTable's "On Data Change" --> Update another Schema.another Table

KnightbeatFeb 22 2010 — edited Feb 22 2010
I need to know how to write a trigger so that it listens to a table*(table 1)* of one schema & immediately updates another table(table 2) which exists in another schema, on any data change (record insert/update or delete) in the 1st table I mentioned.

[I didn't read anything about this before I ask this. So I just need to know whether it's possible or not. I don't expect you to spend a lot of time on this. But I will be much thankful, if you could tell me whether this is possible to be done or not]

Thanks!

Comments

Anurag Tibrewal
Hi,

With whatever requirement you posted so far, it is possible.
You need to write a dml trigger (insert/update/delete) on the table1. Inside the trigger you would be writing a code to do the changes on table2.
Points to remember
- schemaA(where table1 resides) needs the direct insert/update/delete privilege on table2 of schemaB.
- Prefix schema name with table2 inside the trigger.

Regards
Anurag
Knightbeat
Thank you so much, for the reply.

I can't even imagine how did you reply so quickly! I think my question was 100% answered, and now I can surf to know how it can be done, as I now know that It's possible to be done!

Thank you very much! I really appreciate your generosity!
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 22 2010
Added on Feb 22 2010
2 comments
420 views