Subject | RE: [firebird-support] Sql |
---|---|
Author | agung wibowo |
Post date | 2004-12-23T06:32:48Z |
SORRY there are something I forgot. :-)
Try this, if I'm not wrong about my understood.
SET TERM ^;
CREATE PROCEDURE GET_FDET (MAX_REC INTEGER, COL INTEGER)
RETURNS (
RNO INTEGER,
EPOCH INTEGER,
MSE DECIMAL ( 18, 10 ),
TRAINTIME timestamp)
AS
DECLARE VARIABLE LINESTART INTEGER;
BEGIN
LINESTART=MAX_REC*(COL-1);
LINESTART=LINESTART+1;
SELECT FIRST MAX_REC SKIP LINESTART RNO, EPOCH,MSE,TRAINTIME FROM FDET
INTO :RNO,:EPOCH,:MSE,:TRAINTIME ORDER BY RNO DESC;
SUSPEND;
END^
From your application
1. SELECT * FROM GET_FDET(1000,1); ==> You get the first
1000 record;
2. SELECT * FROM GET_FDET(1000,2); ==> You get the second
1000 record;
3.
and etc.
with regard,
agung w
[Non-text portions of this message have been removed]
Try this, if I'm not wrong about my understood.
SET TERM ^;
CREATE PROCEDURE GET_FDET (MAX_REC INTEGER, COL INTEGER)
RETURNS (
RNO INTEGER,
EPOCH INTEGER,
MSE DECIMAL ( 18, 10 ),
TRAINTIME timestamp)
AS
DECLARE VARIABLE LINESTART INTEGER;
BEGIN
LINESTART=MAX_REC*(COL-1);
LINESTART=LINESTART+1;
SELECT FIRST MAX_REC SKIP LINESTART RNO, EPOCH,MSE,TRAINTIME FROM FDET
INTO :RNO,:EPOCH,:MSE,:TRAINTIME ORDER BY RNO DESC;
SUSPEND;
END^
From your application
1. SELECT * FROM GET_FDET(1000,1); ==> You get the first
1000 record;
2. SELECT * FROM GET_FDET(1000,2); ==> You get the second
1000 record;
3.
and etc.
with regard,
agung w
[Non-text portions of this message have been removed]