On Mon, 15 Sep 2003, Shridhar Daithankar wrote:
> I was just updating a table in oracle9.2 by hand and bumped into this.
>
> Following seems to be the valid syntax in oracle.
>
> Update foo set somefield=NULL where somefield >9;
>
> Now I am not sure having something equalled with NULL is a good thig logically.
> I would say
>
> Update foo set somefield [to] NULL where somefield >9;
>
> sounds much better. Postgresql uses =default expression which is fine.
>
> Is Oracle behaviour correct?
Yes (and we also allow update foo set somefield=NULL).
<set clause list> ::=
<set clause> [ { <comma> <set clause> }... ]
<set clause> ::=
<object column> <equals operator> <update source>
<update source> ::=
<value expression>
| <null specification>
| DEFAULT
<object column> ::= <column name>
and null specification is:
<null specification> ::=
NULL