Subject | Re: Subselects |
---|---|
Author | Alexander V.Nevsky |
Post date | 2004-03-16T13:25:10Z |
--- In firebird-support@yahoogroups.com, "Bogdan Mugerli"
<mugerlibogdan@e...> wrote:
attentive, you could avoid it. Change query to
SELECT MC1.VALID_FROM, MC1.PRICE FROM MATERIALCENA MC1
WHERE MC1.MATERIALid = :IMATERIALID AND MC1.VALID_FROM =
(select max(MC.VALID_FROM from materialcena mc where mc.materialid =
MC1.MATERIALid and mc.VALID_FROM <= 'today')
AFAIU this bug is fixed in FB1.5 but fix breaks compatibility with
client-side components which for a long time implemented different
workarounds. So it is decided to make fix optionally turned on/off by
OldParameterOrdering parameter in firebird.conf. Did'nt tried to turn
it on myself. Note proper tables aliases usage in modified query too.
Best regards,
Alexander.
<mugerlibogdan@e...> wrote:
> HiFB1.5 ??
>
> I wonder if the occasional problems with subselects are resolved in
>Bogdan, this bug is registered in FB tracker and if you were more
> Here is the excerpt from our procedure:
>
> SELECT VALID_FROM, PRICE FROM MATERIALCENA
> WHERE MATERIALid = :IMATERIALID AND VALID_FROM =
> (select max(MC.VALID_FROM from materialcena mc where mc.materialid =
> :imaterialid and mc.VALID_FROM <= 'today')
> INTO :VALID_FROM, :PRICE;
>
> Suddenly subselect didn't return max(valid_from)
attentive, you could avoid it. Change query to
SELECT MC1.VALID_FROM, MC1.PRICE FROM MATERIALCENA MC1
WHERE MC1.MATERIALid = :IMATERIALID AND MC1.VALID_FROM =
(select max(MC.VALID_FROM from materialcena mc where mc.materialid =
MC1.MATERIALid and mc.VALID_FROM <= 'today')
AFAIU this bug is fixed in FB1.5 but fix breaks compatibility with
client-side components which for a long time implemented different
workarounds. So it is decided to make fix optionally turned on/off by
OldParameterOrdering parameter in firebird.conf. Did'nt tried to turn
it on myself. Note proper tables aliases usage in modified query too.
> PS.: this problem should have been solved years agoAre you ordering?
Best regards,
Alexander.