25.12.2012 Views

Cours SGBD LAI2 - Institut supérieur d'informatique de Mahdia

Cours SGBD LAI2 - Institut supérieur d'informatique de Mahdia

Cours SGBD LAI2 - Institut supérieur d'informatique de Mahdia

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

create procedure <strong>de</strong>truitCompagnie(ma_comp VARCHAR2(20)) is<br />

begin<br />

restePilote EXCEPTION ;<br />

PRAGMA Exception_init(restePilote, -2292);<br />

compagnieInexistante EXCEPTION ;<br />

-- ce n'est pas nécessaire <strong>de</strong> la lier à un co<strong>de</strong> d'erreur<br />

<strong>de</strong>lete from compagnie where comp = ma_comp ;<br />

if SQL%NOTFOUND then<br />

end if ;<br />

exception<br />

end ;<br />

Exemple <strong>de</strong> programme PL/SQL<br />

raise compagnieInexistante ;<br />

when restePilote then<br />

... traitement <strong>de</strong> l'erreur ...<br />

when compagnieInexistante then<br />

...<br />

when others then<br />

... on traite les autres erreurs<br />

Riadh HADJ M’TIR – 2011/2012 221

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!