×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Hi,

instead of using WHENEVER SQLERROR, you can check SQLCOD or SQLSTT directly.
If an error occured the SQLCOD is less than *Zeros and the first two digits
are not '01' and not '00' and not '02'.

C/EXEC SQL  ....
C/END-EXEC
 /Free

   If SQLCOD < *Zeros;  //Error occured
      //Do whatever you want
   EndIf;

SQLSTT should be prefered because this is SQL standard.

Birgitta


-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von Knezevic, Mihael
Gesendet: Montag, 19. Dezember 2005 14:51
An: RPG programming on the AS400 / iSeries
Betreff: embedded sql error handling


hi,

i've started reading myself into the topic embedded sql and i'm wondering
how i'am going to catch the errors which might occur at runtime. i have seen
some constructs like:

C/EXEC SQL WHENEVER SQLERROR GOTO ...
C/END-EXEC

but these things only helps in a non-/free environment with the tag keyword.
how do i code it without the tag keyword in a /free block. and how do i know
which error occured (error code and description).

any help or/and links would be nice.

i search the info center and read the topic "embedded sql programming" but
found nothing there (perhaps i overlooked something)

thanx in advance

mk

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




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