Re: INSERT cursor -- part two - 4GL error logging
Posted in 1998
Carlson@WHSmith wrote: > > Jonathan Leffler wrote: > > > > Carlson@WHSmith wrote: > > > > > > Added the FLUSH -- (thanks for the reminder, Gary). > > > > Shouldn't matter -- the CLOSE and the COMMIT both imply a flush. > > I was able to use the FLUSH to check sqlca.sqlerrd[3]. The sum of the > FLUSH insert number and the PUT insert number should equal the number of > PUTs that I executed. Hence, if they are not the same, then don't > commit that transaction. Somehow, I wasn't able to check > sqlca.sqlerrd[3] on a COMMIT; it always returned 0. > > > > > > Added a row check to the number of rows processes and to > > > sqlca.sqlerrd[3] after PUT and FLUSH. > > > > > > All seemed right with the world . . until . . . > > > > > > I noticed that a grouping took much longer than normal to complete. > > > Cross-referenced it to the log and found that a checkpoint occurred, > > > with another large update job running. > > > > So far, so normal. > > > > > From that point on, my row counts were off and no commits took place. > > > > Weird. > > > > > Any ideas about what happened? This is all so new to me . . . <G> > > > > Did you have WHENEVER ANY ERROR STOP set? Do you have CALL STARTLOG() > > or CALL fgl_startlog() in your code? Do the log files say anything > > useful? > > > > Unfortnuately, no. But I will be doing some testing today and I'll > eliminate the WHENEVER ERROR CONTINUE. I'm curious where the error (if > any) would be taking place. I have sqlcode checks after each PUT; maybe > that's not enough. > > Thanks for all your help. > > John Carlson > Informix DBA > WH Smith, Inc. It might be useful to know that having WHENEVER ERROR GOTO mylabel causes a record to be made in the log file, unlike WHENEVER ERROR CONTINUE. I use it in released 4GL software with a general error catcher routine below the mylabel. Precede mylabel with a WHENEVER ERROR CONTINUE statement to prevent complaints in the next function about a non-existent label. I call all my 4GL programs through a shell script which, on 4GL exit, checks the log file for the string "error" (not case-sensitive) and mails me any which contain errors. This is useful for discovering rare errors. It also impresses the users. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 --- If all else fails, read the instructions AND the release notes. All opinions are my own and not those of Bayer plc. My Internet plumbing does not allow me to mail and post news together. Sorry. --- Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/