Report lines can be rolled back?
Posted in 1998
Topics: General Discussion
Informix v7.23 In a automatic order entry program, I was having a problem with report lines disappearing. I discovered that the problem only occured on report lines that happened within a BEGIN WORK...ROLLBACK WORK statement. Now, I know that report lines are stored in a temporary table, so I understand that a ROLLBACK WORK statement may cause the lines that have been put in that table to be un-inserted. But why would it only affect some of them? I decided to write a little test program to illustrate this, and was hoping someone else has ran into this feature (?) and had any idea what Informix is doing here. The odd thing is, you would expect the program to either show 100 lines for each line of text, or show no lines for the rolled back line of text. But it does neither. It actually shows 100 lines for the committed line of text, and 96 for the rolled back line. What am I missing here? As a temporary solution, I have just taken out the ROLLBACK work, but I do kinda need that in there to undo some database updates. Thanks in advance. Jamie Hatfield --------- BEGIN PROGRAM LISTING DATABASE db MAIN DEFINE i INTEGER START REPORT rbreport TO "rbreport.out" BEGIN WORK FOR i=1 TO 100 OUTPUT TO REPORT rbreport("This line will be committed") END FOR COMMIT WORK BEGIN WORK FOR i=1 TO 100 OUTPUT TO REPORT rbreport("This line will be rolled back") END FOR ROLLBACK WORK FINISH REPORT rbreport END MAIN REPORT rbreport(line) DEFINE line CHAR(80), counter1, counter2 INTEGER ORDER BY line FORMAT FIRST PAGE HEADER LET counter1 = 0 LET counter2 = 0 ON EVERY ROW IF line = "This line will be committed" THEN LET counter1 = counter1 + 1 ELSE LET counter2 = counter2 + 1 END IF AFTER GROUP OF line IF line = "This line will be committed" THEN PRINT GROUP COUNT(*) USING " ####", counter1 USING " ####", " ", line CLIPPED ELSE PRINT GROUP COUNT(*) USING " ####", counter2 USING " ####", " ", line CLIPPED END IF END REPORT