3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by debasisdas
0

Before - Before table or record event
After - After table or record event
Why does that confuse you?

0

Before - Before table or record event
After - After table or record event
Why does that confuse you?

they confuse me becouse
when we insert any record into the table they
inserted while using before or after
in both the cases the record is insert into the table.
that's why i'm confuse. so,tell me when we use the "before trigger"
and when "after trigger"....

0

Well... Yes.
The record is going into the database.
a) What do you want to happen just before the record is inserted.
This is usually used to populate; a primary key, an audit column, etc.
b) What do you want to happen just after the record is inserted.
This might be used to insert another record (related to this one) into another table.
Either way (unless there is an error), the record is going into the table.
You can also write before and after triggers on deletions and updates.
Those are the six common table triggers.
They can be written "For Each Row" or for a single transaction.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.