Subject | Re: [firebird-support] What is wrong with this SP? (BIGINT range) |
---|---|
Author | Velja Radenkovic |
Post date | 2006-04-11T23:45:23Z |
On 4/10/06, Helen Borrie <helebor@...> wrote:
FOR SELECT gets N rows i.e. 0, 1 or more in a loop and
operates on each row one by one. If SELECT SUM(ULAZ), SUM(IZLAZ) ... returns
as one row
----------------------------------------------------------------------------
SUM_OF_ULAZ_VALS | SUM_OF_IZLAZ_VALS
----------------------------------------------------------------------------
FOR will pass through only once.
got them very fast on multiple SPs with "missused" FOR loop.
Off course, I'll correct the SPs to use SELECT INTO syntax but wanted share
my results here.
Velja
[Non-text portions of this message have been removed]
>It seams that the correct statement is:
> No. To get a one-row result you use the SELECT ..... INTO
> <variables> syntax. FOR SELECT gets multiple rows in a loop and
> operates on each row one by one.
FOR SELECT gets N rows i.e. 0, 1 or more in a loop and
operates on each row one by one. If SELECT SUM(ULAZ), SUM(IZLAZ) ... returns
as one row
----------------------------------------------------------------------------
SUM_OF_ULAZ_VALS | SUM_OF_IZLAZ_VALS
----------------------------------------------------------------------------
FOR will pass through only once.
>2. Correct results are much bigger. The SUM of any 10 values is larger thanI'm assuming that my stmt is correct because I got very correct results and
> >above.
>
> With you syntax, you would be getting the values of the last row
> processed. SUM(ONE_VALUE) should return some kind of exception, but
> apparently not if it worked for you.
got them very fast on multiple SPs with "missused" FOR loop.
Off course, I'll correct the SPs to use SELECT INTO syntax but wanted share
my results here.
Velja
[Non-text portions of this message have been removed]