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

Home -> Community -> Usenet -> c.d.o.server -> Re: pl/sql error handling

Re: pl/sql error handling

From: Greg Akins <insomnia_at_cvzoom.net>
Date: Mon, 16 Oct 2000 21:34:21 GMT
Message-ID: <39eb73c4.692056@news.cvzoom.net>

Just use the exception block to write errors to another file? (with UTL_FILE.) Or write exceptions to an seperate error Table

like
begin
insert into table values (x, y, z) ;
exception
when others then
  commit ;
  insert into error_log values (Errormsg) end ;

On Mon, 16 Oct 2000 16:46:56 -0400, ionut <ionut_at_provsys.com> wrote:

>Maybe you guys could help me out...
>I have a sql script used to migrate data from some tables in new ones.
>There is some processing to be done there as well, so i do this in a
>loop.
>I'm using a spool file to check for the errors.
>Unfortunately there may be inconsistent data in the old tables, so those
>rows wont be inserted which is still ok. I want them reported in the
>spool file though.
>With no error handlers, the first error would cause the loop to be
>aborted, so i would be missing all the subsequent rows.
>If I'm placing an error handler around the insert statement like
>
>......
>begin
> insert into new_table..
>EXCEPTION WHEN OTHERS THEN
> commit;
> end;
>it would fix this problem, but in the log file there will no longer be
>reported an error.
>Any idea how to write to that spool file the error.
>I donut want to insert the errors in a table or something like that, i
>want oracle to direct the errors to the spool file
>
>
>much appreciated
>

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =----- Received on Mon Oct 16 2000 - 16:34:21 CDT

Original text of this message

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