2

2



projektSBDnowy.txt

create or replace trigger new_worker after insert on workers for each row begin

dbms_output.put_line ("We have NEW worker!');

end;

/ --trigger that checks if new updated price of the parts isn't lower than the old one

create or replace trigger part_price before update of price on parts for each row begin

if :new.price < :old.price then

dbms_output.put_line ('New price is lower than the previous one!');

end if;

if :new.price > :old.price then

dbms_output.put_line ('Now we eam morę!!!');

end if;

excepdon

when others then

dbms_output.put_line ('New price is the same as the old one!');

end;

/ -trigger that don't allows to delete the boss of the company

create or replace trigger dontremoveboss before delete on workers for each row begin

if :old.posidon = 'boss' then

raise_application_error(-20446,'Cannot delete BOSS!');

end if;

end;

/ —this simple trigger display info about deleting each dient

create or replace trigger del_dients after delete on dients for each row begin

dbms_output.put_line(’Now we have one dient less. What a pitty!');

end;

/ -trigger which checks types of engine in new cars, only gas or diesel are acceptable

create or replace trigger engine_type before inesert on types for each row begin

if :new.engine_type o 'diesel' and :new.engine_type <> 'gas'

then raise_applicadon_error(-20444,'We do not service that type of engines!');

end if; end;

/ -asks to check correctness of added personal data

Strona 2


Wyszukiwarka

Podobne podstrony:
projektSBDnowy.txt .create or replace trigger personal_data after update on dients for each
DROP FUNCTION opis_rabatu(TEXT); CREATE OR REPLACE FUNCTION opis_rabatu(k TEXT) RETURNS TEXT AS $$
owa 0602 i Untitled - PL/Formatter Personal Eile Edit yiew H8lp& * q m ** create or replace proc
42060 img092 (25) There are three underlined words or phrases (marked A, B and C) in sentences 21 -
00268 ?a148167663d78e6679e602ee961c3b 270 Montgomery experiments are often used in the design and/o
tmta9 Frock (or tunic) Many outdoor workers wore a garment which seems rel-ated in cut to the gown,
looks,loads, records, or playslike the new Dual 828. t « .    . rt/V . • • • d •
skan 3 Grammar past simpłe or past continuous? New English File Teacher * Book Pre-intermediate Phot
trg scp1 ABORt *RST or pon trigger system initiated IDLE no longer INITiated INITiated (still) I NIT
WHERE k.id_klienta=nr AND k.id_klienta=t.id_klienta; RETURN x; END; LANGUAGE ’plpgsql ; CREATE OR

więcej podobnych podstron