|
Hi Mihael, > 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). > You have to check the SQLSST variable which is set after each SQL operation. for example: c FetchFileA begsr c/exec sql c+ fetch next c+ from FileACursor c+ into :FileARec c/end-exec c select c when SQLstt = '00000' c eval EndOfFileA = false c when SQLstt = '02000' c eval EndOfFileA = true c when %subst( SQLstt : 1 : 2 ) = '01' c exsr SQLwarning c other c exsr SQLError c endsl c endsr In the SQLWarning and SQLError routines you'll have to define what action needs to be taken. HTH, Arco Simonse
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.