Oracle exceptions/error handling
Date: 20 May 2002 10:27:39 -0700
Message-ID: <b4cefdce.0205200927.2c45b419_at_posting.google.com>
Hi there.
I've have a requirement to write several Oracle procedures and have
come across an issue with exceptions that I can't resolve on my own.
The crux of my problem is the following:
SELECT something INTO avariable FROM somewhere
An ORA-6502 (value error) is raised, which I catch, because the query
doesn't returns an empty resultset on occasions (and thus the contents
of 'avariable' are undefined).
Rather than catching the error, I want the procedure to continue with
the SQL underneath where the exception was raised, sort of like an ON
ERROR JUSTIGNOREANDCARRYONWITHTHEREMAININGSQLBELOW.
I'm embarassed to tell you my current solution but essentially it
involves catching the exception, then using a GOTO to resume in the
main body. And I know it is far from elegant.
There must be a better way. Ideas anyone?
Thank you
Dave
Received on Mon May 20 2002 - 19:27:39 CEST