Subject Re: Running Number on Results
Author Adam
Well I don't think generators are particularly useful here. If two
people run the query at the same time, the numbers are likely to be
skipped or reset to 0 in the middle, and that is not really the point
of generators.

I am not aware of anyway you can do it in FB 1.5 without using a
stored procedure. (Which is a pretty easy operation)

create procedure getemployeelist
(
)
returns
(
fakerecordnumber integer,
firstname varchar(50),
lastname varchar(50)
)
as
begin
fakerecordnumber = 1;
for select firstname, lastname from employee
into :firstname, :lastname do
begin
suspend;
fakerecordnumber = :fakerecordnumber + 1;
end
end

Not that I would want to put this work onto the database engine. Now
I don't know enough about the background of your problem to offer
much advice, but either the number is relevant to the data stored (in
which case it should be stored in a field in the table), or you are
just wanting to do some formatting etc, which would be better / less
work / faster if it was done at the client end.

Adam