× 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.



"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 03/02/2019
12:08:45 PM:
Just define SQLSTATE (Char(5) ) or SQLCODE (SmallInt) within the stored
procedure and then use them like the SQLCODE or SQLSTATE variables
within
embedded SQL?
i.e.
DECLARE SQLSTATE Char(5) Default '00000';

If SQLSTATE = '02000' Then Leave YourLoop;
End If;


Birgitta,

So, you're saying that the following statement is not needed in a
MAIN stored procedure as long as you've declared a variable called exactly
"SQLSTATE". Does the same apply when having the following statement as
the first statement in a global exception handler? Meaning: The previous
value of the SQLSTATE variable is still available in the global exception
handler?


Get Current Diagnostics Condition 1 CurState = Returned_SqlState;


One final question... Am I correct that the presence of the above
statement prevents default error handling for the previous statement?
...and, if so, how does that work when just checking an "SQLSTATE"
variable in the absence of GET CURRENT DIAGNOSTICS?


Sincerely,

Dave Clark

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.