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


  • Subject: RE:SQL: Error handlling (was SQL UPDATE question
  • From: jpcarr@xxxxxxxxxxxx
  • Date: Sat, 9 Jun 2001 14:41:59 -0400



How about something like this?   If the code is greater than zero,  But not
100 an SQL warning error happened.
Maybe you were putting a character field into too small of a target field,
The warning error might tell you
that some info was truncated.  In certain cases you may say  "I'm ok with
that"  so maybe not a HALT error
for you in that case.


In the case it's negative, you can get the SQL code (you can even concant
it with 'SQL"
and look up the message in QSQLMSG message file).



C         Select
C         When SQLCod  <  0
C         ExSR SQLError

C         When SQLCod = 100
C         ExSR NoMoreRows

C         When ( SQLCod  >0  Or SQLWn0 <> *Blank )
C         ExSR SQLWaning

C         Other
C         ExSR ProcessRow
C         EndSL



John Carr

------------------------------------------------
    * Check after each SQL statement to make sure
    * it executed as expected
   C              if    SQLCOD <> SQL_OK
   C              exsr  SqlErrorHandler
   C              endif
Pete,
I would like to know more about your SqlErrorHandler routine (if you don't
mind).  Right now I watch for 100, and not 0 or 100, to identify errors.
If
the sqlcod isn't 0 or 100, I assume something unrecoverable happened.
Phil





+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.