Re: String concatenation in 4gl
Posted in 1996
Create a string: LET str = "select a || b as c, sum(d) from e group by 1" PREPARE stm FROM str DECLARE csr CURSOR FOR stm FOREACH csr INTO ... ... END FOREACH Note, too, that reports can handle many levels of grouping these days; more than just 16. Of course, you have to be using new enough software, but I believe that from 4.13/6.01 (maybe 4.14/6.02) onwards, you can group by more levels than you can understand. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> PS: If you need input parameters to the SELECT, replace them by ? in the string, and use FOREACH csr USING ... INTO ... -- again assuming you have the more recent I4GL. >Date: Wed, 07 Aug 1996 15:14:56 +1200 >From: Peter Tashkoff <TASHKOP@kiwi.co.nz> >X-Informix-List-Id: <list.10934> > >It's a day for questions... >In sql you can do this > >select a || b as c, sum(d) from e group by 1 > >In our legacy system we need to group by >16 levels >and so want to do the above but can't figure out how >to do it in 4gl. It's possible that we could code this >in an SP as a workaround. >Any advice much appreciated.