|
Hello Sergio
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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx<mailto:
MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx<mailto:
MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:
support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.
.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
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.