×
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.
Not every SQLCODE other than 0 or 100 is an error - only those < 0 are hard errors. I was told to do something like this - I prefer a first Fetch, then the Dow loop with a Fetch before the EndDo - I know, this is a religious choice, so I will not discuss it!!
exec sql
fetch ...;
dow sqlcode >= 0 and sqlcode <> 100;
...;
...;
exec sql
fetch ...;
enddo;
Positive SQLCODE are often about something that makes the statement less efficient - 12 (unqualified correlation) or 30 (# of host variables different from # of result values) might not be a problem, they are just an indication of sloppy coding practice.
Cheers
Vern
On Thu, 9 Mar, 2023 at 4:39 AM, Sergio Luis Puentes-Valladares <spuentes@xxxxxxxxx> wrote:
To: midrange systems technical discussion
Hi Gerald
After all Fetch or Select, you must control the result of these operations,
using SQLCODE verification, through an IF, the value returned by SQLCODE =
0000, operation was performed correctly, in this case FETCH was able to
read a record or Select found what
I was looking for, SQLCODE = 0100, It means that the FETCH or SELECT
operation did not find anything, any other value is ERROR
Regards
Sergio L Puentes Valladares
IT Developer SR IBM i RPG/COBOL
As an Amazon Associate we earn from qualifying purchases.
This thread ...
Re: sql fetch, wasn't there something we could put in the sql select statement, or the sql fetch to "look ahead" to see if we are at the end, (continued)
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.