Bernt M. Johnsen wrote:
> Retuning a double here is also in line with the SQL standard:
>
> 5) If <extract expression> is specified, then
> Case:
>
> a) If <primary datetime field> does not specify SECOND, then the
> declared type of the result is an implementation-defined exact
> numeric type with scale 0 (zero).
>
> b) Otherwise, the declared type of the result is an
> implementation-defined exact numeric type with scale not less than
> the specified or implied <time fractional seconds precision> or
> <interval fractional seconds precision>, as appropriate, of the
> SECOND <primary datetime field> of the <extract source>.
>
> (BTW: The datetime scalar functions are e.g. {fn SECOND(t)} in JDBC escape
> syntx, but should have been EXTRACT(SECOND FROM t) in SQL had Derby been fully
> stabdards compliant)
Well..... there's more here..... DOUBLE is not an "exact numeric type" so Derby
is in this respect neither SQL standards compliant nor compliant to it's own
docs.... ;-)
--
Bernt Marius Johnsen, Database Technology Group,
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway