Re: Strange behavior : I4GL , transactions AND reports = Lost data
Posted in 2012
The cursor that's closing is the one the report module uses internally to fetch back sorted data from the temp table it uses when you include an ORDER BY clause. If there is no ORDER BY or it is ORDER BY EXTERNAL then no temp table is created, so no cursor within the report. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, Nov 30, 2012 at 6:08 AM, Isidre Pons Roca <ipons@base.cat> wrote: > Hi Art, > > Thanks so much for your quick response. > > I know that if I open cursors are closed when I do a "commit". > But in the example I don't see where I put the cursor. > > TIA > ------------------------------ > *De: *"Art Kagel" <art.kagel@gmail.com> > *A: *"Isidre Pons Roca" <ipons@base.cat> > *Cc: *informix-list@iiug.org > *Enviat: *Divendres, 30 de Novembre 30el 2012 11:53:39 > *Assumpte: *Re: Strange behavior : I4GL , transactions AND reports = Lost > data > > COMMIT WORK will close any open cursors that were not declared to be WITH > HOLD, maybe that's your problem. > > Art > > Art S. Kagel > Advanced DataTools (www.advancedatatools.com) > Blog: http://informix-myview.blogspot.com/ > > Disclaimer: Please keep in mind that my own opinions are my own opinions > and do not reflect on my employer, Advanced DataTools, the IIUG, nor any > other organization with which I am associated either explicitly, > implicitly, or by inference. Neither do those opinions reflect those of > other individuals affiliated with any entity with which I am affiliated nor > those of the entities themselves. > > > > On Fri, Nov 30, 2012 at 4:30 AM, Isidre Pons Roca <ipons@base.cat> wrote: > >> Hi all, >> >> After a long fighting , we could not solve a very weird problem. >> >> In a program with I4GL transactions and reports, lost data in the report. >> (See example below) >> >> However, only if the report have an "order by" clause, never witout >> this clause or "order external by" clause. >> >> We tested two different environments and two different versions of the >> product with the same result. >> Test 1: Solaris 10, I4GL 7.50.FC1 >> Test 2: Centos 64b, I4GL 7.50.FC6 >> >> Someone can help us? >> What is wrong? >> >> Thanks in advance >> >> Isidre >> >> #----- Beguin example TEST.4gl---- >> #--------------------------------------------------------- >> # >> # Strange behavior I4GL : Transactions and reports >> # >> # (c) BASE - Gesti d'Ingressos >> # Isidre Pons >> # 11/30/2012 v 1.0 >> # >> #--------------------------------------------------------- >> database oartdb >> >> >> #------------------------------------------------------------------------------- >> main >> >> #------------------------------------------------------------------------------- >> define i smallint >> >> start report test_1 to "kk.out" >> >> for i = 1 to 10 >> begin work >> if (i mod 3) = 0 then >> display "Commited value :",i >> commit work >> else >> display "Rollback value :",i >> rollback work >> end if >> output to report test_1(i) >> end for >> >> finish report test_1 >> prompt "Press a key : " for char status >> >> end main >> >> >> #------------------------------------------------------------------------------- >> report test_1(r_value) >> >> #------------------------------------------------------------------------------- >> define r_value smallint >> >> output >> left margin 0 >> top margin 0 >> bottom margin 0 >> >> order by r_value >> # order external by r_value >> >> format >> >> after group of r_value >> display " ---------- > change of group ",r_value >> print " ---------- > change of group ",r_value >> >> on every row >> display " Row: ",r_value clipped >> print " Row: ",r_value clipped >> end report >> #---- End example TEST.4gl ----------- >> >> >> >> >> [image: BASE-Gesti'' d] >> >> *Advertiment legal*: Aquest missatge i, si escau, els fitxers annexos >> tenen caire confidencial, especialment pel que fa a les dades personals, i >> s'adrecen e xclusivament al destinatari referenciat. Si vostè no ho és i >> l'ha rebut per error o se li ha fet arribar per qualsevol motiu, us demanem >> que ens ho comuniqui per aquesta mateixa via i el destrueixi o l'esborri i, >> en tot cas, s'abstingui d'utilitzar, reproduir, alterar, arxivar o >> comunicar a tercers aquest missatge i fitxers annexos, tot sota pena >> d'entrar en responsabilitats legals. >> *Abans d'imprimir aquest missatge o qualsevol dels documents adjunts, si >> us plau comproveu que és veritablement necessari.* >> >> *Advertencia legal*: Este mensaje y, en su caso, los ficheros anexos son >> confidenciales, especialmente en lo que respecta a los datos personales, y >> se dirigen exclusivamente al destinatario referenciado. Si usted no lo es y >> lo ha recibido por error o tiene conocimiento del mismo por cualquier >> motivo, le rogamos que nos lo comunique por este medio y proceda a >> destruirlo o borrarlo, y que en todo caso se abstenga d e utilizar, >> reproducir, alterar, archivar o comunicar a terceros el presente mensaje y >> ficheros anexos, todo ello bajo pena de incurrir en responsabilidades >> legales. >> *Antes de imprimir este mensaje o cualquiera de los documentos adjuntos, >> por favor compruebe que es verdaderamente necesario.* >> >> *Disclaimer*: This message and any attached files transmitted with it, >> is confidential, especially as regards personal data. It is intended solely >> for the use of the individual or entity to whom it is addressed. If you are >> not the intended recipient and have received this information in error or >> have accessed it for any reason, please notify us of this fact by email >> reply and then destroy or delete the message, refraining from any >> reproduction, use, alteration, filing or communication to third parties of >> this message and attached files on penalty of incurring legal >> responsibilities. >> *Before printing this message or any attachments, plea se check that it >> is really necessary.* >> >> ------------------------------ >> . >> >> >> _______________________________________________ >> Informix-list mailing list >> Informix-list@iiug.org >> http://www.iiug.org/mailman/listinfo/informix-list >> >> > > > [image: BASE-Gesti'' d] > > *Advertim