Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace TRIGGER INSERT_TO_COMMANDES_rdm
- BEFORE INSERT ON commandes_rdm
- for each row
- declare cursor curs_client is (select code_client from clients_rdm);
- cursor curs_emp is (select no_employe from employes);
- possible number(1);
- BEGIN
- possible := 0;
- for codeclient in curs_client
- loop
- for emp in curs_emp
- loop
- if(codeclient.code_client = :new.code_client and emp.no_employe = :new.no_employe)
- then
- possible := 1;
- end if;
- end loop;
- end loop;
- if(possible = 0)
- then
- raise_application_error(-20005, 'Le tuple insere ne peut exister sur cette base, essayer une autre localisation');
- end if;
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement