Subject FIRST does not take parameters in Stored Procedure?
Author dr_bentonquest
Hi there,

The following SP does compile OK:

create procedure TESTSP (howmany integer)
returns (sgrupo integer)
as
begin
for select grupo from articulos into :sgrupo do suspend;
end


However, using FIRST with a parameter causes error:

create procedure TESTSP (howmany integer)
returns (sgrupo integer)
as
begin
for select first :howmany grupo from articulos into :sgrupo do
suspend;
end

I got this error first:

Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 5, char 22.
:.

Then, removing the : from the howmany parameter causes this error:

SQL error code = -104.
Token unknown - line 5, char 22.
howmany.

Note that a numeric constant instead of the parameter *does* work OK.

Am I missing something?

Thanks in advance for your help,

-Jorge
-Using FB 1.0 for Linux.