Subject | Re: [firebird-support] Re: Select first 3 and last 3 records |
---|---|
Author | Norbert Nemeth |
Post date | 2005-06-09T10:56:59Z |
> Thanks MailMur howeverPerhaps this way:
> as far as I know the From Select statement will only be implemented in Ver 2
> so I am back to my original problem
CREATE PROCEDURE PRC_XXXX (
PRNID CHAR(002))
RETURNS (
PRNID INTEGER,
INVNO INTEGER )
AS
BEGIN
/* First 3 records selection... */
FOR SELECT FIRST 3 PRNID
, INVNO
FROM ORDTRN
WHERE PRNID = :PRNID
ORDER BY INVNO ASC
INTO :PRNID,
:INVNO
DO
BEGIN
SUSPEND;
END
/* Last 3 records selection... */
FOR SELECT FIRST 3 PRNID
, INVNO
FROM ORDTRN
WHERE PRNID = :PRNID
ORDER BY INVNO DESC
INTO :PRNID,
:INVNO
DO
BEGIN
SUSPEND;
END
END
Regards,
Norbert