PragmaInitEg

PragmaInitEg - C INT OUR_DIV_OF_SOMETHING_BY_ZERO EXCEPTION...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 /* Program to demonstrate pragma EXCEPTION_INIT The pragma EXCEPTION_INIT associates an exception name with an Oracle error number. That lets you refer to any internal exception by name and to write a specific handler for it instead of using the OTHERS handler */ DECLARE A INT B INT
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: C INT OUR_DIV_OF_SOMETHING_BY_ZERO EXCEPTION PRAGMA EXCEPTION_INIT(OUR_DIV_OF_SOMETHING_BY_ZERO,-1476) BEGIN A := 0 B := 2 C := B / A DBMS_OUTPUT.PUT_LINE('C IS: ' || C) EXCEPTION WHEN OUR_DIV_OF_SOMETHING_BY_ZERO THEN DBMS_OUTPUT.PUT_LINE('HEY, A DIVISION BY ZERO!') END...
View Full Document

Ask a homework question - tutors are online