home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / database / informix / 1896 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  2.3 KB

  1. Path: sparky!uunet!mcsun!uknet!edcastle!spider!raft.spider.co.uk!ivan
  2. From: ivan@spider.co.uk (Ivan Reid)
  3. Newsgroups: comp.databases.informix
  4. Subject: FOR loop in ACE - bug?
  5. Keywords: report
  6. Message-ID: <1992Sep9.104715.4047@spider.co.uk>
  7. Date: 9 Sep 92 10:47:15 GMT
  8. Followup-To: comp.databases.informix
  9. Organization: Spider Systems Limited, Edinburgh, UK.
  10. Lines: 52
  11.  
  12. Hi folks! I've come across a very annoying bug in Informix's report
  13. writer. Have any of you had similar experiences, and what was your
  14. workaround? Mine was to split the report into two and link them using
  15. a shell-script. Not very satisfactory, since it takes twice as long,
  16. and still approaches the size/complexity limit for ACE. Anyway, here's
  17. the scenario:
  18.  
  19. {Extract of report to perform repeated summations of columns for a period}
  20.  
  21. VARIABLE mx integer    {month}
  22. VARIABLE yx integer    {year}
  23. VARIABLE sm integer    {start month}
  24. VARIABLE em integer    {end month}
  25. ...
  26. LET sm=4
  27. LET em=12
  28. ...
  29. ON LAST ROW
  30. FOR yx = 1992 TO 1993
  31. DO BEGIN
  32.    IF yx=1993 THEN BEGIN    {yes, I know this is logically a bit messy ...}
  33.            LET sm=1
  34.            LET em=3
  35.            END
  36.  
  37.    FOR mx = sm TO em
  38.    DO BEGIN    {A}
  39.     LET totalA = GROUP TOTAL OF columname 
  40.              WHERE month=mx AND year=yx
  41.     ... <lots of code> ...
  42.     PRINT .....
  43.       END    {B}
  44.    END   
  45.  
  46. The FOR loop control values work and are PRINTed ok, but the GROUP
  47. TOTALs don't work as they should. The columns "month" and "year" are
  48. both integer types, so match those of "mx" and "yx". My only recourse
  49. was to scrap the FOR loops and duplicate the large chunks of code
  50. between {A} and {B} (12 times!), substituting the appropriate values
  51. for mx and my. This meant that the report exceeded ACE's
  52. size/complexity limit, and had to be coded as two reports, reporting
  53. to separate files, ultimately linked by a shell-script.
  54.  
  55. FOR loops in ACE are claimed by the manual to be valid, and I can't
  56. see any errors in the code above (types,syntax etc..). I am very
  57. annoyed with INFORMIX! The only potentially mitigating factor is that
  58. we've got an old release of INFORMIX. But even then ....! Grrrr!
  59. -- 
  60. Ivan Hans Mark Reid                      Management Information Systems Analyst
  61. "Information is Power ..."                                   Spider Systems Ltd
  62. vox: (+44 31) 554 9424                                 Spider Park, Stanwell St
  63. fax: (+44 31) 554 0649                              Edinburgh EH6 5NG, SCOTLAND
  64.