Subject | Re: SELECT FIRST |
---|---|
Author | Nico Callewaert |
Post date | 2004-04-26T14:15:01Z |
Ok Helen, thanks !
Best regards, Nico
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
Best regards, Nico
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 01:19 PM 26/04/2004 +0000, you wrote:so I may
> >Hi,
> >
> >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,
> >not use a SELECT FIRST.create a
>
> You have to do what we used to do before we had SELECT FIRST -
> selectable SP:int,
>
> create procedure getfirst(inparam1 sometype, inparam2..., retrows
> 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