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



--
[ Picked text/plain from multipart/alternative ]
Hi Bob,

SQLCOD 1-99 are warnings
SQLCOD < 0   are SQL-Errors.

If I want to display a SQL-Error-Message, I use the following trick:
All SQL-Messages are in the QSQLMSG Message-File
The Message-Id of an SQL-Error is SQL + absolute value of SQLCOD.
(SQLCOD -302 --> 'SQL0302')

On the other hand I wouldn't use WHENEVER, i prefere a simple IF in my
RPG-Program:

C                   Do       *HiVal

C/EXEC SQL
C+ Fetch SqlSKR into :DS_SQLSK
c/END-EXEC

C                   if        SQLCOD      = 100
C                   leave
C                   endif

C                   if        SQLCOD      < 0
C                   eval      MsgId      = 'CPF9898'
C                   eval      MsgTxt    = RtvSqlMsg(SQLCOD)
C                   exsr     SndPgmMsg
C                   leave
C                   endif

I hope that helps

Birgitta Hauser



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.