0% found this document useful (0 votes)
34 views77 pages

SQL Lab - Trigger

The document defines a trigger that fires after inserts on the orders table. The trigger gets the username of the user performing the insert and inserts a record into the orders_audit table with the new order details and username. An error occurs because the orders_audit table has not been defined.

Uploaded by

priya n
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
34 views77 pages

SQL Lab - Trigger

The document defines a trigger that fires after inserts on the orders table. The trigger gets the username of the user performing the insert and inserts a record into the orders_audit table with the new order details and username. An error occurs because the orders_audit table has not been defined.

Uploaded by

priya n
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 77

SQL> CREATE TABLE orders

2 ( order_id number(5),
3 quantity number(4),
4 cost_per_item number(6,2),
5 total_cost number(8,2),
6 create_date date,
7 created_by varchar2(10)
8 );

Table created.

SQL> ed
Wrote file afiedt.buf

1 CREATE OR REPLACE TRIGGER orders_before_insert


2 BEFORE INSERT
3 ON orders
4 FOR EACH ROW
5 DECLARE
6 v_username varchar2(10);
7 BEGIN
8 -- Find username of person performing INSERT into table
9 SELECT user INTO v_username
10 FROM dual;
11 -- Update create_date field to current system date
12 :new.create_date := sysdate;
13 -- Update created_by field to the username of the person performing the INSERT
14 :new.created_by := v_username;
15* END;
16 /

Trigger created.

SQL> insert into orders values(101,4,3,12,'','');

1 row created.

SQL> select * from orders


2 ;

ORDER_ID QUANTITY COST_PER_ITEM TOTAL_COST CREATE_DA CREATED_BY


---------- ---------- ------------- ---------- --------- ----------
101 4 3 12 11-SEP-21 SYSTEM

SQL> ed
Wrote file afiedt.buf

1* insert into orders values(102,3,3,9,'','');


2 /
insert into orders values(102,3,3,9,'','');
*
ERROR at line 1:
ORA-00911: invalid character

SQL> ed
Wrote file afiedt.buf

1* insert into orders values(102,3,3,9,'','');


SQL> /
insert into orders values(102,3,3,9,'','');
*
ERROR at line 1:
ORA-00911: invalid character

SQL> ed
Wrote file afiedt.buf

1* insert into orders values(102,3,3,9,'','')


SQL> /

1 row created.

SQL> ed
Wrote file afiedt.buf

1 CREATE OR REPLACE TRIGGER orders_after_insert


2 AFTER INSERT
3 ON orders
4 FOR EACH ROW
5 DECLARE
6 v_username varchar2(10);
7 BEGIN
8 -- Find username of person performing the INSERT into the table
9 SELECT user INTO v_username
10 FROM dual;
11 -- Insert record into audit table
12 INSERT INTO orders_audit
13 ( order_id,
14 quantity,
15 cost_per_item,
16 total_cost,
17 username )
18 VALUES
19 ( :new.order_id,
20 :new.quantity,
21 :new.cost_per_item,
22 :new.total_cost,
23 v_username );
24* END;
25 /

Warning: Trigger created with compilation errors.

SQL> insert into orders values(103,4,4,16,'','');


insert into orders values(103,4,4,16,'','')
*
ERROR at line 1:
ORA-04098: trigger 'SYSTEM.ORDERS_AFTER_INSERT' is invalid and failed
re-validation

SQL> SELECT * FROM USER_TRIGGERS;

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
ORDERS_AFTER_INSERT AFTER EACH ROW

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
INSERT

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
SYSTEM TABLE ORDERS

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
REFERENCING NEW AS NEW OLD AS OLD

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
ENABLED

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
orders_after_insert

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
AFTER INSERT

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
ON orders

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
FOR EACH ROW

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
PL/SQL

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
DECLARE

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
v_username varchar2(10);

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
BEGIN

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
-- Find username of person performi

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
NO NO NO NO NO NO YES NO

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
ORDERS_BEFORE_INSERT BEFORE EACH ROW

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
INSERT

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
SYSTEM TABLE ORDERS

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
REFERENCING NEW AS NEW OLD AS OLD

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
ENABLED

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
orders_before_insert

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
BEFORE INSERT

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
ON orders

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
FOR EACH ROW

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
PL/SQL

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
DECLARE

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
v_username varchar2(10);

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
BEGIN

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
-- Find username of person performi

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
NO NO NO NO NO NO YES NO

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
REPCATLOGTRIG AFTER STATEMENT

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
UPDATE OR DELETE

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
SYSTEM TABLE REPCAT$_REPCATLOG

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
REFERENCING NEW AS NEW OLD AS OLD

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
ENABLED

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
system.repcatlogtrig

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
AFTER UPDATE OR DELETE ON system.repcat$_repcatlog

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
PL/SQL

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
BEGIN

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
sys.dbms_alert.signal('repcatlog_alert', '');

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
END;

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
NO NO NO NO NO NO YES NO

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
DEF$_PROPAGATOR_TRIG BEFORE STATEMENT

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
INSERT

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
SYSTEM TABLE DEF$_PROPAGATOR

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
REFERENCING NEW AS NEW OLD AS OLD

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
ENABLED

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
system.def$_propagator_trig

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
BEFORE INSERT ON system.def$_propagator

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
PL/SQL

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
DECLARE

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
prop_count NUMBER;

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
BEGIN

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
SELECT count(*) into prop_count

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
FROM s

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---
NO NO NO NO NO NO YES NO

TRIGGER_NAME TRIGGER_TYPE
------------------------------ ----------------
TRIGGERING_EVENT
--------------------------------------------------------------------------------
TABLE_OWNER BASE_OBJECT_TYPE TABLE_NAME
------------------------------ ---------------- ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
REFERENCING_NAMES
--------------------------------------------------------------------------------
WHEN_CLAUSE
--------------------------------------------------------------------------------
STATUS
--------
DESCRIPTION
--------------------------------------------------------------------------------
ACTION_TYPE
-----------
TRIGGER_BODY
--------------------------------------------------------------------------------
CROSSED BEF BEF AFT AFT INS FIR APP
------- --- --- --- --- --- --- ---

SQL> SELECT TRIGGER_NAME FROM USER_TRIGGERS;

TRIGGER_NAME
------------------------------
ORDERS_AFTER_INSERT
ORDERS_BEFORE_INSERT
REPCATLOGTRIG
DEF$_PROPAGATOR_TRIG

SQL> ed ORDERS_AFTER_INSERT

SQL> show ORDERS_AFTER_INSERT


SP2-0735: unknown SHOW option beginning "ORDERS_AFT..."
SQL> select dbms_metadata.get_ddl('TRIGGER','MY_TRG',user) from dual;
ERROR:
ORA-31603: object "MY_TRG" of type TRIGGER not found in schema "SYSTEM"
ORA-06512: at "SYS.DBMS_METADATA", line 4018
ORA-06512: at "SYS.DBMS_METADATA", line 5843
ORA-06512: at line 1

no rows selected

SQL> ed
Wrote file afiedt.buf

1* select dbms_metadata.get_ddl('TRIGGER','ORDERS_AFTER_INSERT',user) from dual


SQL> /
DBMS_METADATA.GET_DDL('TRIGGER','ORDERS_AFTER_INSERT',USER)
--------------------------------------------------------------------------------

CREATE OR REPLACE TRIGGER "SYSTEM"."ORDERS_AFTER_INSERT"


AFTER INSERT
ON

SQL> ed
Wrote file afiedt.buf

1* select text from user_source where name='&trig_name' and type='TRIGGER';


SQL> /
Enter value for trig_name: ORDERS_AFTER_INSERT
old 1: select text from user_source where name='&trig_name' and type='TRIGGER';
new 1: select text from user_source where name='ORDERS_AFTER_INSERT' and type='TRIGGER';
select text from user_source where name='ORDERS_AFTER_INSERT' and type='TRIGGER';
*
ERROR at line 1:
ORA-00911: invalid character

SQL> SHOW LONG


long 80
SQL> SET LONG 20000
SQL> SHOW LONG
long 20000
SQL> select dbms_metadata.get_ddl('TRIGGER','ORDERS_AFTER_INSERT',user) from dual;

DBMS_METADATA.GET_DDL('TRIGGER','ORDERS_AFTER_INSERT',USER)
--------------------------------------------------------------------------------

CREATE OR REPLACE TRIGGER "SYSTEM"."ORDERS_AFTER_INSERT"


AFTER INSERT
ON orders
FOR EACH ROW
DECLARE
v_username varchar2(10);
BEGIN
-- Find username of person performing the INSERT into the table
SELECT user INTO v_username
FROM dual;

DBMS_METADATA.GET_DDL('TRIGGER','ORDERS_AFTER_INSERT',USER)
--------------------------------------------------------------------------------
-- Insert record into audit table
INSERT INTO orders_audit
( order_id,
quantity,
cost_per_item,
total_cost,
username )
VALUES
( :new.order_id,
:new.quantity,
:new.cost_per_item,

DBMS_METADATA.GET_DDL('TRIGGER','ORDERS_AFTER_INSERT',USER)
--------------------------------------------------------------------------------
:new.total_cost,
v_username );
END;
ALTER TRIGGER "SYSTEM"."ORDERS_AFTER_INSERT" ENABLE

SQL>

SQL> select TRIGGER_NAME FROM USER_TRIGGERS;

TRIGGER_NAME
------------------------------
ORDERS_AFTER_INSERT
ORDERS_BEFORE_INSERT
REPCATLOGTRIG
DEF$_PROPAGATOR_TRIG

SQL> DROP TRIGGER ORDERS_BEFORE_INSERT


2 ;

Trigger dropped.

You might also like