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

Explain what are the type of synonyms?

573


Can objects of the same schema reside in different tablespace?

578


What is the difference between alert log file and tarce file ?

1626


What are the original export and import utilities?

562


How do we get field detail of a table?

613






What is analyze command used for?

567


HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.

981


Can we store images in oracle database?

541


How to start a new transaction in oracle?

580


What is data block in Oracle?

610


Explain a private synonyms?

623


What is a sub query and what are the different types of subqueries?

611


Is it possible to center an object horizontally in a repeating frame that has a variable horizontal size ?

1867


What is execute immediate in oracle?

537


what are steps for interface? where is exchange rate defined in which table?

1479