Tuesday, 16 February 2016

INVALID_NUMBER EXAMPLE

INVALID_NUMBER:This Exception will be raised when end user entered the wrong data.

Example:
BEGIN
INSERT INTO EMP(EMPNO,ENAME,SAL,DEPTNO)
VALUES(&EMPNO,'&ENAME',&SAL,&DEPTNO);
EXCEPTION
WHEN INVALID_NUMBER THEN
DBMS_OUTPUT.PUT_LINE('SORRY WRONG VALUE ENTERED TRY ANOTHER ONE');
END;

No comments:

Post a Comment

If you Like my blog Spread it and help friends for whom this blog is useful for their career.