Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: pl/sql error handling
In article <39EB6940.4FFA3CA_at_provsys.com>,
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
>
You can use dbms_output package to print info into a spool file. It has restrictions though, about 1M per session.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Oct 16 2000 - 16:38:00 CDT