Re: 4GL: SQLCA.SQLERRD[2] = 0 after insert in serial field
Posted in 2004
Richard Spitz wrote: > Jean Sagi <jeansagi@myrealbox.com> schrieb: > > >>Maybe you have reached a maximun value for that column... but I'm only >>guessing... > > > No, that is definitely not the case. The serial value is now in the > 33000 range, and as I wrote, the insert and the creation of the serial > value works ok. It was just the SQLCA.SQLERRD[2] that was suddenly > not being set correctly any more. > > I reviewed the code and found that there was a "COMMIT WORK" statement > between the INSERT statement and the readout of the SQLERRD[2] value. > I was able to get rid of the explicit transaction so the readout > comes directly after the INSERT, and now it works again. That would do it - COMMIT rezeroes the value. You have to treat SQLCA as very volatile; it changes per SQL statement, as you know. > I'm just wondering why the error started to appear. There was definitely > NO CHANGE in the module in question for almost two years, but the error > just started to occur a few days ago. Somebody changed something a few days ago. For example, someone installed a new version of the software, or removed the old version (from five years ago) and people suddenly found that the new version (from two-and-a-half years ago) was on their path and started using it? -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/