what are Triggers?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I call oracle stored procedures that take no parameters?

560


how can we store any pdf file in oracle

1634


What is an oracle table?

550


What are the ways tablespaces can be managed and how do they differ?

1612


types of indexes and the rationale behind choosing a particular index for a situation.

1976






 How to use an oracle sequence generator in a mapping?

556


What is data file?

610


What is the difference between PFILE and SPFILE in Oracle?

573


How to run create database statement again?

618


How to create a single index for multiple columns?

556


How to login to the server without an instance?

616


What is transaction control statement and how many types of transaction control statement in Oracle?

562


What is oracle used for?

531


How to count groups returned with the group by clause in oracle?

568


How to join two tables in a single query using oracle?

560