SQL-J Language Reference
Page 94 of 121

DATE

DATE provides for storage of a year-month-day in the range supported by java.sql.Date.

Syntax for Column Definition

DATE

Corresponding Compile-Time Java Type

java.sql.Date

JDBC Metadata Type (java.sql.Types)

DATE

Dates, times, and timestamps must not be mixed with one another in expressions.

SQL-J is more permissive than SQL-92 in the values and formats it permits in date/time literals. Any value that is recognized by the java.sql.Date, java.sql.Time or java.sql.Timestamp valueOf(String) method is permitted in a column of the corresponding SQL-J date/time data type.

Literal Syntax

[DATE]'YYYY-MM-DD'

DATE Literal Examples

VALUES DATE'1994-02-23'

VALUES '1993-09-01'