--DUP_VAL_ON_INDEX EXCEPTION EXAMPLE
*********************************************************************************
BEGIN
INSERT INTO EMP(EMPNO,ENAME,SAL) VALUES(&EMPNO,'&ENAME',&SAL);
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
DBMS_OUTPUT.PUT_LINE('SORRY RECORD ALREADY EXIST');
END;
*********************************************************************************
BEGIN
INSERT INTO EMP(EMPNO,ENAME,SAL) VALUES(&EMPNO,'&ENAME',&SAL);
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
DBMS_OUTPUT.PUT_LINE('SORRY RECORD ALREADY EXIST');
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.