Have you ever tried out laundry hamper before ??? if not then explore the link to know about it more. It's an easy to use tool that will helps to lift bulk laundry items. I am sure you all will like it very much. Just fill, zip and roll thats it you are done with it. It really gives you very good comfort. I found it really useful. Don't forget to spread the word to all your friends. Keep checking my blog for more latest tips and updates.
Perfumes are often presented as part of a gift set at the best moment, or to get matching with aroma in your body, if now you are searching for womens perfume and fragrances you should check this http://www.savebuckets.co.uk/browse/body-care-cosmetics/perfumes/women/. This site is like Amazon, but this site is especially for perfumes. In this site you can search a lot of perfumes that you like and find the cheapest prices. This site link to another sites which sell over a hundred of perfumes like Britney Spears- Fantasy, Gucci Rush, Diesel for elite unlimited women and many others, you don’t need to search in Google or Amazon to find the best price for your perfumes.. You can compare prices for perfumes in this site. So, you can find the cheapest perfumes or the perfumes you like for a perfect gift or treat yourself with easily searching in this site. Don’t forget to look out for special offers or discounts when searching for a perfume.
PREDEFINED EXCEPTIONS
1.
SQL> DECLARE
2 VAR EMP.SAL%TYPE;
3 BEGIN
4 INSERT INTO STUDENT VALUES(6780,'KARTHIK',12); // this statement not executed due to no data found error at line 5
5 SELECT SAL INTO VAR FROM EMP WHERE ENAME='ABC';
6 DBMS_OUTPUT.PUT_LINE(VAR);
7 END;
8 /
DECLARE
*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at line 5
SQL> SELECT *FROM STUDENT;
ROLLNO NAME STD
---------- ---------- ----------
2346 TARUN 9
7890 MARIE 11
SQL> DECLARE
2 VAR EMP.SAL%TYPE;
3 BEGIN
4 INSERT INTO STUDENT VALUES(6780,'KARTHIK',12);// now this statement get executed by handling no data found exception
5 SELECT SAL INTO VAR FROM EMP WHERE ENAME='ABC';
6 DBMS_OUTPUT.PUT_LINE(VAR);
7 EXCEPTION
8 WHEN NO_DATA_FOUND THEN
9 DBMS_OUTPUT.PUT_LINE('no such employee');
10 END;
11 /
no such employee
PL/SQL procedure successfully completed.
SQL> SELECT *FROM STUDENT;
ROLLNO NAME STD
---------- ---------- ----------
2346 TARUN 9
7890 MARIE 11
6780 karthik 12
2.
SQL> DECLARE
2 RESULT NUMBER(4);
3 BEGIN
4 RESULT:=5/0;
5 EXCEPTION
6 WHEN NO_DATA_FOUND THEN
7 DBMS_OUTPUT.PUT_LINE('No such data');
8 WHEN OTHERS THEN
9 DBMS_OUTPUT.PUT_LINE(SQLCODE);
10 DBMS_OUTPUT.PUT_LINE(SQLERRM);
11 END;
12 /
-1476
ORA-01476: divisor is equal to zero
PL/SQL procedure successfully completed.
USER DEFINED EXCEPTIONS
• for logical error handling
SQL> SELECT *FROM DEPT;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> DECLARE
2 INVALID_DEPTNO EXCEPTION;
3 BEGIN
4 UPDATE DEPT
5 SET DNAME='MANAGEMENT',LOC='CHENNAI'
6 WHERE DEPTNO=&DNO;
7 IF(SQL%NOTFOUND) THEN
8 RAISE INVALID_DEPTNO;
9 END IF;
10 COMMIT;
11 EXCEPTION
12 WHEN INVALID_DEPTNO THEN
13 DBMS_OUTPUT.PUT_LINE('No such deptno');
14 END;
15 /
Enter value for dno: 50
old 6: WHERE DEPTNO=&DNO;
new 6: WHERE DEPTNO=50;
No such deptno
PL/SQL procedure successfully completed.
NON PREDEFINED EXCEPTIONS
1 DECLARE
2 unik_con EXCEPTION;
3 PRAGMA EXCEPTION_INIT(unik_con,-0001); // Here -0001 is the std code for unique key violation error and unik_con is user defined
4 BEGIN
5 INSERT INTO dept values(10,'Finance','ch');
6 EXCEPTION
7 WHEN unik_con THEN
8 DBMS_OUTPUT.PUT_LINE('Exception Caught');
9 when others then
10 DBMS_OUTPUT.PUT_LINE('Other Exceptions');
11* END;
SQL> /
Exception Caught
RAISE_APPLICATION_ERROR
in executable section
1 DECLARE
2 EMP_NF EXCEPTION;
3 PRAGMA EXCEPTION_INIT(EMP_NF,-20013);
4 BEGIN
5 DELETE FROM EMP WHERE EMPNO=0009;
6 IF(SQL%NOTFOUND) THEN
7 RAISE_APPLICATION_ERROR(-20013,'No such empno');
8 END IF;
9* END;
SQL> /
DECLARE
*
ERROR at line 1:
ORA-20013: No such empno
ORA-06512: at line 7
1 DECLARE
2 EMP_NF EXCEPTION;
3 PRAGMA EXCEPTION_INIT(EMP_NF,-20013);
4 BEGIN
5 DELETE FROM EMP WHERE EMPNO=0009;
6 IF(SQL%NOTFOUND) THEN
7 RAISE_APPLICATION_ERROR(-20013,'No such empno');
8 END IF;
9 EXCEPTION
10 WHEN EMP_NF THEN
11 DBMS_OUTPUT.PUT_LINE('Exception caught');
12* END;
SQL> /
Exception caught
in exception section
SQL> DECLARE
2 VAR EMP.SAL%TYPE;
3 BEGIN
4 SELECT SAL INTO VAR FROM EMP WHERE ENAME='ABC';
5 DBMS_OUTPUT.PUT_LINE(VAR);
6 EXCEPTION
7 WHEN NO_DATA_FOUND THEN
8 RAISE_APPLICATION_ERROR(-20009,'no such employee');
9 END;
10 /
DECLARE
*
ERROR at line 1:
ORA-20009: no such employee
ORA-06512: at line 8
PROPAGATION
Basic propagation:
SQL> declare
2 bla number;
3 begin
4 declare
5 no number;
6 begin
7 select deptno into no from emp where deptno=80; -- no data found exception arised
8 dbms_output.put_line('This wont be printed'); -- skipped
9 exception
10 when no_data_found then
11 dbms_output.put_line('Exception caught here');
12 end;
13 select deptno into bla from emp where ename='KING';
14 dbms_output.put_line(bla); -- prints value 10
15 end;
16 /
Exception caught here
10
PL/SQL procedure successfully completed.
Relevant exception caught (rest of the statements skipped)
SQL> declare
2 bla number;
3 begin
4 declare
5 no number;
6 begin
7 select deptno into no from emp where deptno=10; -- control transferred to line 15
8 dbms_output.put_line('This wont be printed');
9 exception
10 when no_data_found then
11 dbms_output.put_line('Exception not caught here');
12 end;
13 select deptno into bla from emp where ename='KING';
14 dbms_output.put_line('bla wont be printed');
15 exception
16 when too_many_rows then
17 dbms_output.put_line('Many rows access exception');
18 end;
19 /
Many rows access exception
PL/SQL procedure successfully completed.
Scope of exception:
SQL> declare
2 bla number;
3 begin
4 declare
5 no number;
6 begin
7 select deptno into no from emp where deptno=80; -- control transferred to line 9
8 dbms_output.put_line('This wont be printed');
9 exception
10 when no_data_found then
11 dbms_output.put_line('Exception caught here');
12 end;
13 select deptno into bla from emp where ename='KING';
14 dbms_output.put_line(bla);
15 exception -- This wont get caught
16 when no_data_found then
17 dbms_output.put_line('Exception not caught');
18 end;
19 /
Exception caught here
10
PL/SQL procedure successfully completed.
Calling exception from exception (Re-raise)
SQL> declare
2 bla number;
3 begin
4 declare
5 no number;
6 begin
7 select deptno into no from emp where deptno=80; -- ctrl tranferred to line 9
8 dbms_output.put_line('This wont be printed');
9 exception
10 when no_data_found then
11 raise; -- ctrl transferred to line 15
12 end;
13 select deptno into bla from emp where ename='KING';
14 dbms_output.put_line(bla);
15 exception
16 when no_data_found then
17 dbms_output.put_line('Exception caught here oly');
18 end;
19 /
Exception caught here oly
PL/SQL procedure successfully completed.