Subject | Re: UPDATE and SQL conformance |
---|---|
Author | lacakus |
Post date | 2008-12-04T10:56:45Z |
Hi Dmitry,
Thank you very much for answer!
Yes now I see it :
"The <update source> of each <set clause> is effectively evaluated
for each row of T before any row of T is updated.
For each subject row, a candidate new row is constructed by copying
the subject row and updating it as
specified by each <set clause> by applying the General Rules of
Subclause 14.12, "<set clause list>"."
-Laco.
Thank you very much for answer!
Yes now I see it :
"The <update source> of each <set clause> is effectively evaluated
for each row of T before any row of T is updated.
For each subject row, a candidate new row is constructed by copying
the subject row and updating it as
specified by each <set clause> by applying the General Rules of
Subclause 14.12, "<set clause list>"."
-Laco.
>and
> lacakus wrote:
> >
> > I encounter following situation (problem?):
> >
> > update table1
> > set column1=value1, column2=column1
> > where ...
> >
> > When I run this statement in Firebird (also in MySQL), evaluation
> > assignment of each <set clause> is done sequentialy, so at theend of
> > statement column2 equals to value1<set
>
> Accordingly to the SQL specification, this is wrong.
>
> > When I run this statement in MS SQL Server, right sides of each
> > clause> are evaluated first and assignment is done after, so atthe end
> > of statement column2 equals to original "OLD.column1"you
>
> This is correct.
>
> Starting with v2.5 Beta, FB will behave correctly by default, but
> can revert back to the legacy mode via firebird.conf.
>
>
> Dmitry
>