CALCULATE MAX(iChair) TO lnMaxChairsAgnes
> CREATE CURSOR curTable (cTableNumber c(1), iChair I) > INSERT INTO curTable VALUES ('1',4) > INSERT INTO curTable VALUES ('2',3) > INSERT INTO curTable VALUES ('3',2) > INSERT INTO curTable VALUES ('4',6) > > > create cursor xx ( xx I) > insert into xx values(1) > > > > select cTableNumber, ; > cTableNumber + '.' + padl(Id,1) as cChairNumber ; > from curTable ; > join ( ; > select cast(1 as int) as Id from xx ; > union select cast(2 as int) from xx ; > union select cast(3 as int) from xx ; > union select cast(4 as int) from xx ; > union select cast(5 as int) from xx ; > union select cast(6 as int) from xx ; > union select cast(7 as int) from xx ; > union select cast(8 as int) from xx ; > union select cast(9 as int) from xx ; > ) Chair on ( Id <= iChair ); > into cursor tmp ; > order by 1, 2 > >>