Subject records to columns
Author Sergio H. Gonzalez
Hello I have an stored procedure to make a report and I need to conver the data
of a sum of some records into a column. So far I'm doing this, and it works
without problem, but I just wander if there is other way to do it, since the
selects I'm using are equal to each other but jyst une number in a var name...

If I just could reference a var by its name (with a string) like I did some
years ago with Clipper... :)

SELECT
SUM(IMPORTE)
FROM
FAC
WHERE
(COL = 1)
INTO
:OUT_COL1;

SELECT
SUM(IMPORTE)
FROM
FAC
WHERE
(COL = 2)
INTO
:OUT_COL2;


SELECT
SUM(IMPORTE)
FROM
FAC
WHERE
(COL = 3)
INTO
:OUT_COL3;

and so on... until col5

Any other way to do the same in a FB stored procedure?

Thanks !

-sergio