Triggers in dbms
Triggers in dbms
Table created.
Trigger created.
no rows selected.
1 row created.
Back up db:
we need to create a back up for every insert or update table in a trigger so that i
will maintain a copy of the database tables which i have aleardy created.
Table created.
Creating a Existing Trigger:
Trigger created.
1 row deleted.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
6 rows selected.
6 rows selected.
1 row updated.
6 rows selected.
7 rows selected.
1 row updated.
6 rows selected.
8 rows selected.
Back up table is always going to have a new entry for every insertion and updation
i.e we are having three entries with 111 with a new entry A,X and new record of
salary 55000.
Table Created.
So this time only the salary attribute should be >0 ie :new.salary>0
1 row created.
SQL> insert into emp2 values(444,'F',5000,'ME');
1 row created.
SQL> select * from emp2;
Trigger created.
update the salary with the new one then check the record is existed in the database
1 row updated.
Table created.
Trigger created
1 row created.
example:
if you try to write the record as old instead of new than it shows the NULL values.
because their is no old values is recorded in the database system of transaction
name is created.
Let's modify the trigger again:
Trigger created.
Remember that Trigger1 cannot be violated means that trigger1 condition must be
satisfied,if i want to update the salary must be greater than the older one.
1 row updated.
1 row updated.