Subject | Re: [firebird-support] SELECT FIRST |
---|---|
Author | Helen Borrie |
Post date | 2004-04-26T13:58:45Z |
At 01:19 PM 26/04/2004 +0000, you wrote:
selectable SP:
create procedure getfirst(inparam1 sometype, inparam2..., retrows int,
skiprows int)
returns ( pkvalue int, outparam1 sometype, outparam2...)
as
begin
for select pkvalue, blah...from..
where...
order by ...
into :pkvalue, :outparam1, :outparam2...
do begin
if (retrows = 0 or pkvalue is null) then
exit;
skiprows = skiprows - 1;
if (skiprows < 1) then
begin
suspend;
retrows = retrows -1;
end
end
end
/hb
>Hi,You have to do what we used to do before we had SELECT FIRST - create a
>
>How could I convert a 'SELECT FIRST....' statement back to IB 5.6
>? Problem is the queries have to remain compatible with IB 5.6, so I may
>not use a SELECT FIRST.
selectable SP:
create procedure getfirst(inparam1 sometype, inparam2..., retrows int,
skiprows int)
returns ( pkvalue int, outparam1 sometype, outparam2...)
as
begin
for select pkvalue, blah...from..
where...
order by ...
into :pkvalue, :outparam1, :outparam2...
do begin
if (retrows = 0 or pkvalue is null) then
exit;
skiprows = skiprows - 1;
if (skiprows < 1) then
begin
suspend;
retrows = retrows -1;
end
end
end
/hb