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 Exception ideas?

Re: PL/SQL Exception ideas?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Sat, 20 Nov 1999 00:44:21 +0800
Message-ID: <38357E65.2D8A@yahoo.com>


Doug Cowles wrote:
>
> I'm importing files containing a lot of bad data with the UTL_FILE
> package.
> This includes dates in the format , / / , i.e., no real date.
> Naturally, if
> I do a to_date on this, I get an exception, but I don't want to bail out
> of the program
> and roll to the bottom, I just want to skip it. I thought of two ways,
> neither one
> I like very much. 1) Build a separate function that tries to convert to
> a date and
> returns a boolean value indicating wether it was valid or 2) put a goto
> in the exception
> handler to continue rolling through the data. Does anyone have any
> cleaner ideas?
>
> - Dc.
>
> ---------------------------------------------------------------
>
> Name: vcard.vcf
> Part 1.2 Type: text/x-vcard
> Encoding: 7bit
> Description: Card for Doug Cowles

raise a user defined exception

declare
  loop_around exception;
begin
  loop
   begin

     get each record
     if not valid then raise loop_around;
     ..
     ..
     ..

    exception when loop_around then null;     end;
  end loop;
end;
--

Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Fri Nov 19 1999 - 10:44:21 CST

Original text of this message

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