Convert 4GL-programs to work with databases in transaction
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi everybody, we have a problem concerning Informix 4GL and the database with transactions. Since we must change to databases with transaction recording, it is now necessary that CURSORS ... FOR UPDATES and "LOCK .." commands must be done in one transaction. However, when a COMMIT WORK is executed it seems that at this time all existing cursors will be closed. A further accessing to this cursor (eg. with FETCH) then results in the error "-400 unopen cursor". Consequently it seems to be impossible to use, "COMMIT WORK" in procedures, since this has unforeseeable results to the calling programs. I hope anybody have a solution or a workaround for this problem. Thanks in advance, Kai Andersen. ************************************** DELICom DPD Deutscher Paket Dienst GmbH & Co. KG Wailandtstrasse 1, D-63741 Aschaffenburg Tel.: +49 (0)6021/492-6040 Fax: +49 (0)6021/492-6502 Email: Kai.Andersen@dpd.de Internet: Http://www.dpd.de **************************************
DECLARE such CURSORS WITH HOLD. Rudy Kai Andersen wrote: > Hi everybody, > > we have a problem concerning Informix 4GL and the database with > transactions. > Since we must change to databases with transaction recording, it is now > necessary that CURSORS ... FOR UPDATES and "LOCK .." commands must be > done in one transaction. However, when a COMMIT WORK is executed it seems > that at this time all existing cursors will be closed. > A further accessing to this cursor (eg. with FETCH) then results in the > error > "-400 unopen cursor". > Consequently it seems to be impossible to use, "COMMIT WORK" in procedures, > since this has unforeseeable results to the calling programs. > I hope anybody have a solution or a workaround for this problem. > > Thanks in advance, > Kai Andersen. > > ************************************** > DELICom > DPD Deutscher Paket Dienst GmbH & Co. KG > Wailandtstrasse 1, D-63741 Aschaffenburg > Tel.: +49 (0)6021/492-6040 > Fax: +49 (0)6021/492-6502 > Email: Kai.Andersen@dpd.de > Internet: Http://www.dpd.de > **************************************
In article <879m7j$3jsvm$1@fu-berlin.de>, "Kai Andersen" <andersen@dpd.de> wrote: > > Hi everybody, > > we have a problem concerning Informix 4GL and the database with > transactions. > Since we must change to databases with transaction recording, it is now > necessary that CURSORS ... FOR UPDATES and "LOCK .." commands must be > done in one transaction. However, when a COMMIT WORK is executed it seems > that at this time all existing cursors will be closed. > A further accessing to this cursor (eg. with FETCH) then results in the > error > "-400 unopen cursor". > Consequently it seems to be impossible to use, "COMMIT WORK" in procedures, > since this has unforeseeable results to the calling programs. > I hope anybody have a solution or a workaround for this problem. > > Thanks in advance, > Kai Andersen. > > ************************************** > DELICom > DPD Deutscher Paket Dienst GmbH & Co. KG > Wailandtstrasse 1, D-63741 Aschaffenburg > Tel.: +49 (0)6021/492-6040 > Fax: +49 (0)6021/492-6502 > Email: Kai.Andersen@dpd.de > Internet: Http://www.dpd.de > ************************************** > > Looks to me like you might have to recode some of the cursor definitions. Yes the commit work will close the cursor. The solution to your problem would be to declare "cursors with hold". Doing so will still keep the cursor open. Hope this helps. For more information RTFM Thanks Ram S. Sent via Deja.com http://www.deja.com/ Before you buy.