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



I generally do as Birgitta explains below but I DO use WHENEVER

c/exec sql
C+ WHENEVER SQLERROR CONTINUE
c/end-exec

Which executes the next line of code after the SQL statement that checks for 
the SQLSTT , etc. 


Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx 
[mailto:rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx] On Behalf 
Of Knezevic, Mihael
Sent: Monday, December 19, 2005 8:18 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: embedded sql error handling

thanx for the quick answer. 

> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx 
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of HauserSSS
> Sent: Monday, December 19, 2005 3:12 PM
> To: RPG programming on the AS400 / iSeries
> Subject: AW: embedded sql error handling
> 
> 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.
> 
> 
> 
> -- 
> 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 ...


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.