Subject | Re: [firebird-support] How to iterate through the records |
---|---|
Author | Helen Borrie |
Post date | 2005-03-03T13:08:48Z |
At 09:02 AM 3/03/2005 -0300, you wrote:
This will do it:
SELECT FIRST 1 DATE_INI FROM SALE
WHERE DATE_INI < :DATE_INI
ORDER BY 1 DESC
You don't need a SP to do this.
If you want to iterate through a set in a SP, that is something else. Ask
again with a suitable pseudocode example.
./hb
>Hello:I don't think you mean "iterate".
>I would like know if exists a manner of iterate through the records
>inside a stored procedure. For instance:
>I created a sp with following statement:
>
>SELECT DATE_INI FROM SALE WHERE DATE_INI = :VDATE;
>
>Well, I need, next, retrieve the record prior to the record retrieve for
>the select clause above.
>How to do it?
This will do it:
SELECT FIRST 1 DATE_INI FROM SALE
WHERE DATE_INI < :DATE_INI
ORDER BY 1 DESC
You don't need a SP to do this.
If you want to iterate through a set in a SP, that is something else. Ask
again with a suitable pseudocode example.
./hb