Dag H. Wanvik wrote:
Mark Thornton <[EMAIL PROTECTED]> writes:
Derby 10.2.2 appears to reject constant expressions enclosed in
parentheses (which should still be constant).
I think this is correct according to the SQL standard; in section
"11.5 <default clause>" of ISO/IEC 9075-2:2003, the syntax is shown
as:
<default clause> ::= DEFAULT <default option>
<default option> ::=
<literal>
| <datetime value function>
| USER
| CURRENT_USER
| CURRENT_ROLE
| SESSION_USER
| SYSTEM_USER
| CURRENT_PATH
| <implicitly typed value specification>
and once you add parentheses around the zero, it is no longer a
literal, although constant.
Dag
The Derby documentation (10.3
http://db.apache.org/derby/docs/10.3/ref/rrefsqlj30540.html#rrefsqlj30540)
has this
[ [ WITH ] DEFAULT { ConstantExpression | NULL }
Which indicates that something more than just a literal is accepted. So
perhaps that documentation should be updated.
Regards,
Mark Thornton