View previous topic :: View next topic
|
Author |
Message |
Ruchira
New User
Joined: 15 Nov 2006 Posts: 6
|
|
|
|
What are the types of triggers. Please explain giving some example.
Thanks in Advance. |
|
Back to top |
|
|
wanderer
Active User
Joined: 05 Feb 2007 Posts: 199 Location: Sri Lanka
|
|
Back to top |
|
|
Ruchira
New User
Joined: 15 Nov 2006 Posts: 6
|
|
|
|
Hi wanderer,
Thanks a lot 4 ur reply..but sorry i havent studied DB2 in high school, do you ?
Anyways some Interviewer asked exactly the same question in one interview and he again said there r 12 triggers. I didnt get it dats y put it here. Didnt get any help from your link also. Pls man, we r here 2 help each other not to offence anyone. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
This may or may not be what your interviewer was looking for, but it does total 12. From my expreience, it is not the kind of question that would be asked by any good interviewer.
The CAPS are valid SQL statements for triggers. The Before/After is the Activation Time.
Code: |
SELECT
Before
After
VALUES
Before
After
CALL
Before
After
SIGNAL SQLSTATE
Before
After
SET (transition variable)
Before
INSERT
After
UPDATE
After
DELETE
After
|
The above info is from the linked manual. We do not need to memorize things like this, (which is why i said a good interviewer would not ask it), but we do need to be familiar with the reference material for the tools we are using/going to use. For what it is worth, i do not believe wanderer meant to offend you. I believe he chose a different way to express the thought that the question was not a good one.
Don't know if this fits anywhere in this question, but there is also a limit of 12 triggers per table. . . .
We're here if you have questions |
|
Back to top |
|
|
Ruchira
New User
Joined: 15 Nov 2006 Posts: 6
|
|
|
|
Hi,There are 3 types of triggers available in the Database. They are
1.DML Triggers :- These are again 12 types like .. Before INSERT,UPDATE,DELETE and After INSERT,UPDATE,DELETE these 6 triggers are statement level and remaining 6 triggers for each row triggers.
2. Instead of Trggers :- These triggers can be written in Complex views.
3. System triggers :- These triggers are high level triggers. like After login, Before Shutdown etc...
I found it among most freq asked ques category in some DB2 website.
Corrections are welcome. |
|
Back to top |
|
|
|