Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: standards

Re: standards

From: <J.Velikanovs_at_alise.lv>
Date: Thu, 5 Aug 2004 14:47:31 +0300
Message-ID: <OF0AE4B9CB.F7447CBA-ONC2256EE7.0040A4E8-C2256EE7.004187BF@alise.lv>


drop table app_error_log;
drop table number_table;
create table app_error_log (c_sqlcode number, c_sqlerrm varchar2(4000)); create table number_table (n number);
declare
v_sqlcode number;
v_sqlerrm varchar2(4000);
begin for f in 1..10 loop
  begin
    insert into number_table values ('a');   exception
    when others then
    v_sqlcode := sqlcode;
    v_sqlerrm := sqlerrm;
    insert into app_error_log values (v_sqlcode, v_sqlerrm);     commit;
  end;
end loop; end;
/

select * from app_error_log;

SYS:jozh> select * from app_error_log;

 C_SQLCODE C_SQLERRM

---------- ----------------------------
     -1722 ORA-01722: invalid number
     -1722 ORA-01722: invalid number
     -1722 ORA-01722: invalid number
     -1722 ORA-01722: invalid number
     -1722 ORA-01722: invalid number
     -1722 ORA-01722: invalid number
     -1722 ORA-01722: invalid number
     -1722 ORA-01722: invalid number
     -1722 ORA-01722: invalid number
     -1722 ORA-01722: invalid number

10 rows selected.

Some thing like this. I hope you got my idea.

Jurijs
+371 9268222 (+2 GMT)



Thank you for teaching me.
http://otn.oracle.com/ocm/jvelikanovs.html

Raj Jamadagni <rjamya_at_yahoo.com>
Sent by: oracle-l-bounce_at_freelists.org
05.08.2004 14:24
Please respond to oracle-l  

        To:     oracle-l_at_freelists.org
        cc: 
        Subject:        Re: standards


I use it on a regular basis in certain code of mine (on production database that runs 24x7) when I
DON'T want the exception to kill the processing.

Flogging ... dunno, but if you know what the hell you are doing then it is a mighty fine syntax.

How would you otherwise continue in a loop when processing remaining iterations is of paramount
importance than breaking over an ant in the middle of the road??

Over here, we discourage that practice too, but then again there are some exceptions. And yes I
did notice the smiley.
Raj

>
> How about:
>
> PL/SQL Programmers who use exception blocks like this will be flogged,
then fired from their
> job.
>
> EXCEPTION
> WHEN OTHERS THEN
> NULL;
> END;
>
> :)



Best Regards
Raj

select mandatory_disclaimer from company_requirements;  

Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo

Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------



----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Thu Aug 05 2004 - 06:51:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US