9.1k views
5 votes
Create a statement trigger called "bt_maj_adv_trigger" that would be work with both advisor as well as major table. If a record is inserted, deleted or updated in either of the table, the system will insert the user name, table name, date, and the dml command executed on the table. To insert this information, create an appropriate "log_maj_adv" table first before you create the trigger

User Sharry
by
3.3k points

2 Answers

4 votes

Answers ehowhejej

Step-by-step explanation:

User Gangabass
by
3.4k points
4 votes

Answer:

Create or replace trigger at_advisor

after delete or insert or update on advisor

for each row

Begin

if inserting

then

insert into

log_maj_adv

values

(

user, :new.adv_code, sysdate, 'insert'

)

;

elsif deleting

then

insert into

log_maj_adv

values

(

user, :new.adv_code, sysdate, 'delete'

)

;

else

insert into

log_maj_adv

values

(

user, :new.adv_code, sysdate, 'update'

)

;

end if;

End;

Step-by-step explanation:

as per above answer.

User Berline
by
3.7k points