Forum Stats

  • 3,853,807 Users
  • 2,264,277 Discussions
  • 7,905,451 Comments

Discussions

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

Knightbeat
Knightbeat Member Posts: 73
edited Feb 22, 2010 12:40AM in SQL & PL/SQL
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!
Tagged:

Answers

  • Anurag Tibrewal
    Anurag Tibrewal Member Posts: 3,901 Gold Trophy
    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
    Anurag Tibrewal
  • Knightbeat
    Knightbeat Member Posts: 73
    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!
This discussion has been closed.