Create an After Statement Trigger : After Insert Trigger « Trigger « Oracle PL / SQL






Create an After Statement Trigger

    
SQL> CREATE TABLE DEPT(
  2      DEPTNO NUMBER(2),
  3      DNAME VARCHAR2(14),
  4      LOC VARCHAR2(13)
  5  );

Table created.

SQL>
SQL> INSERT INTO DEPT VALUES (10, 'ACCOUNTING', 'NEW YORK');

1 row created.

SQL> INSERT INTO DEPT VALUES (20, 'RESEARCH', 'DALLAS');

1 row created.

SQL> INSERT INTO DEPT VALUES (30, 'SALES', 'CHICAGO');

1 row created.

SQL> INSERT INTO DEPT VALUES (40, 'OPERATIONS', 'BOSTON');

1 row created.

SQL>
SQL>
SQL> 
SQL>  create or replace trigger deptas
  2      after insert or update or delete
  3      on dept
  4      begin
  5         dbms_output.put_line('after statement (dept)');
  6      end;
  7  /

Trigger created.

SQL>
SQL>
SQL> drop table dept;

Table dropped.

   
    
    
    
  








Related examples in the same category

1.Create an 'AFTER INSERT' Trigger
2.Create an After Row Trigger
3.Use user-defined function in trigger