1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
declare
vErrMajMaTable exception;
vErrNum exception;
PRAGMA EXCEPTION_INIT (vErrNum, -01722);
begin
update emp
set sal = 1000000
where empno = 'DIDI'; ---
if sql%notfound then
RAISE vErrMajMaTable;
end if;
EXCEPTION
WHEN vErrMajMaTable THEN
dbms_output.put_line('Pas d''employe avec ce NUMERO ...');
WHEN vErrNum THEN
raise_application_error(-20001,'Veuillez saisir un numero existant');
end;
/
declare
*
ERREUR Ó la ligne 1 :
ORA-20001: Veuillez saisir un numero existant
ORA-06512: Ó ligne 17 |
Partager