× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



TIL....

Thanks Sue!

Charles

On Mon, Jan 29, 2018 at 3:33 PM, Sue Romano <slromano@xxxxxxxxxx> wrote:

It sounds like you need to add some nested compound statements. Handlers
are scoped to the BEGIN/END compound statement where they are defined. You
can have handlers for the same condition in multiple compound statements,
including the outermost level.

Sue Romano
Db2 for IBM i Development


When you have declared an SQL Exception handler, how do you make
an exception for a particular exception? For example...

I have a script that creates an alias in QTEMP during execution.
But, if any other exception occurs, the alias is left in QTEMP. So, I
want to clean up this possibility when the script first starts. This
works if the alias is there. But, if it is not there an exception
occurs.
I want to detect this situation and ignore the exception.

I even tried doing the DROP within the exception handler itself so

that the alias wouldn't be left in QTEMP at all. However, if an
exception
occurs before the alias first gets created, then the exception handler
throws an error during the DROP and the original exception never gets
displayed.

I also thought of creating an SQL Continue handler for the
specific SQL State, but I don't want this SQL State to always continue.

The potential exists for the same SQL State to occur in other places in

the script and I don't want those situations handled the same.

Is there a way to to be even more selective with handlers --
without having to go to the extreme of doing completely away with all
handlers and then having to do error checking on a
statement-by-statement
basis?

How do I handle all this? Thanks.


No responses on this?


Sincerely,

Dave Clark





--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.