Subject | SELECT FIRST [variable] |
---|---|
Author | PenWin |
Post date | 2006-08-29T08:30:37Z |
Hi!
Is it possible to use a variable to limit a number of returned records? That
is, I would like to create something like this:
CREATE PROCEDURE something (maxrows INTEGER)
RETURNS (key INTEGER, value INTEGER) AS
BEGIN
FOR SELECT FIRST :maxrows key, value FROM table INTO :key, :value DO
SUSPEND;
END
Unfortunatelly, Firebird (1.5.2) is returning an error at :maxrows so I
suspect it may require a literal after FIRST. But maybe I am doing something
incorrectly?
Pepak
Is it possible to use a variable to limit a number of returned records? That
is, I would like to create something like this:
CREATE PROCEDURE something (maxrows INTEGER)
RETURNS (key INTEGER, value INTEGER) AS
BEGIN
FOR SELECT FIRST :maxrows key, value FROM table INTO :key, :value DO
SUSPEND;
END
Unfortunatelly, Firebird (1.5.2) is returning an error at :maxrows so I
suspect it may require a literal after FIRST. But maybe I am doing something
incorrectly?
Pepak