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



Chuck,
I really appreciate that complete response, and will endeavor to use it going forward. Working in a very small shop with no one close at hand with the necessary expertise to straighten me out, I'm very grateful to those like yourself that help me to "not go home today as dumb as I was yesterday".
Many thanks!
-- Michael
~~~~~~~~~~~
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Monday, October 24, 2011 4:52 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: SQLSTATE 01004 now appears with v7.1 ?

I had composed this message but failed to send earlier. The OP has
already resolved by making the receiving field large enough to hold all
of the data, but for completeness...

Specifically in response to the question if there are "better ways I
should have coded this to prevent eventual upgrade trauma?":

If the assumption could be made that the "warnings" for a SQLSTATE
could be tolerated, then a better test than "if %subst(SQLSTATE : 1 : 2)
= '00';" would have been the test "if %subst(SQLSTATE : 1 : 2) = '00' OR
%subst(SQLSTATE : 1 : 2) = '01';". The latter because according to the
"SQLCODE and SQLSTATE concepts" at the following link, the "class code
of an SQLSTATE value indicates whether the SQL statement was executed
successfully (class codes 00 and 01) or unsuccessfully (all other class
codes)."
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/topic/rzala/rzalaco.htm

Note: Because the class code may be non-digit characters, the simple
test [of one non-weighted less-than-or-equal comparison] of just "if
%subst(SQLSTATE : 1 : 2) <= '01'" is undesirable. For example, the
class 'A0' is less than the class '01' [because x'C1F0' is less than
x'F0F1'], but the 'A0' is *not* an indication that the SQL statement was
executed successfully.

Another option would have been to test SQLCODE for a zero as return
code instead of testing the SQLSTATE which is more granular; i.e. the
SQLSTATE having the additional ability to diagnose "specific conditions
or classes of conditions."

Regards, Chuck


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.