what are Triggers?
Answers were Sorted based on User's Feedback
Answer / kaarthi v
Triggers are the database objects (Like Procedures) which
will be executed by the Database itself and cannot be
excuted by the user explicitly. The trigger can be written
to execute while inserting/ updating/ deleting a row.
Two types of triiger
ROW LEVEL TRIGGER
===============
Row Level triggers are FOR EACH ROW, that is, the trigger
is activated for each row that is inserted/updated/deleted.
STATEMENT LEVEL TRIGGER
=====================
Statement level triggers will execute the action specified
only once. (Will not consider the no. of rows being
inserted/updated/deleted)
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / akn
Triggers are basically used to implement business rules.
Triggers are also similar to stored procedures.The
difference is that it can be activated when data is added
or edited or deleted from a table in a database.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / jamuna
triggeres are databbase objects this are stored inthe
data base same as the procedures but procedures executed
explicitely byt triggers executed implicitely when
trigger event occures
triggere event means DML OPERATIONES (INSERT,UPDATE,DELETE)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sreekanth
Can anyone tell me in which scenarios row and statement lever can be used?
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / suresh
SQL> CREATE TABLE to_table
2 (col1 NUMBER);
Table created.
SQL> CREATE OR REPLACE TRIGGER statement_trigger
2 AFTER INSERT ON to_table
3 BEGIN
4 DBMS_OUTPUT.PUT_LINE('After Insert Statement
Level');
5 END;
6 /
Trigger created.
SQL> CREATE OR REPLACE TRIGGER row_trigger
2 AFTER INSERT ON to_table
3 FOR EACH ROW
4 BEGIN
5 DBMS_OUTPUT.PUT_LINE('After Insert Row Level');
6 END;
7 /
Trigger created.
SQL> INSERT INTO TO_TABLE VALUES(1);
After Insert Row Level
After Insert Statement Level
1 row created.
SQL> BEGIN
2 INSERT INTO TO_TABLE VALUES(2);
3 INSERT INTO TO_TABLE VALUES(3);
4 INSERT INTO TO_TABLE VALUES(4);
5 INSERT INTO TO_TABLE VALUES(5);
6 INSERT INTO TO_TABLE VALUES(6);
7 INSERT INTO TO_TABLE VALUES(7);
8 INSERT INTO TO_TABLE VALUES(8);
9 INSERT INTO TO_TABLE VALUES(9);
10 INSERT INTO TO_TABLE VALUES(0);
11 END;
12 /
WAT LL BE THE O/P???
XPLAIN IT>>>>
| Is This Answer Correct ? | 0 Yes | 1 No |
how may join possible between (requisition with purchase order)
What is set operator oracle?
What are the different windows events activated at runtime ?
What is the difference between implicit index and explicit index?
What is the effect of setting the 'RULE' for OPTIMIER_GOAL parameter of the ALTER SESSION Command ?
What are the built-in functions used for sending Parameters to forms ?
what is the syntax of INSERT command?
How to create a stored program unit?
Two triggers one is before insert and other is after insert are firing on a table.If 10 times you insert in a table.Then how many times before trigger and how many types after trigger will fire in pl/sql.
What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?
how will I find the first 5 highest salaried employees in each dept in oracle.
How to find out what oracle odbc drivers are installed?