Re: standards

  • From: J.Velikanovs@xxxxxxxx
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 5 Aug 2004 14:47:31 +0300

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@xxxxxxxxx>
Sent by: oracle-l-bounce@xxxxxxxxxxxxx
05.08.2004 14:24
Please respond to oracle-l
 
        To:     oracle-l@xxxxxxxxxxxxx
        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

--- david wendelken <davewendelken@xxxxxxxxxxxxx> wrote:

> 
> 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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: