Subject | SELECT FIRST :n usage in SP |
---|---|
Author | Fabrice Aeschbacher |
Post date | 2003-07-10T10:16Z |
Hi,
It seems that using a parameter for a SELECT FIRST :n statement is not
allowed in SP. For example:
create procedure MyProc ( NumRows integer )
returns ( SomeField integer )
as begin
if (NumRows is null or NumRows = 0) then NumRows = 100;
for select first :NumRows SomeField
from SomeTable
into :SomeField
do suspend;
end !!
Statement failed, SQLCODE = -104
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 8, char 19
-:
Is this intended to be so? Is there a workaround?
Regards,
Fabrice Aeschbacher
It seems that using a parameter for a SELECT FIRST :n statement is not
allowed in SP. For example:
create procedure MyProc ( NumRows integer )
returns ( SomeField integer )
as begin
if (NumRows is null or NumRows = 0) then NumRows = 100;
for select first :NumRows SomeField
from SomeTable
into :SomeField
do suspend;
end !!
Statement failed, SQLCODE = -104
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 8, char 19
-:
Is this intended to be so? Is there a workaround?
Regards,
Fabrice Aeschbacher