Specify era-based dates
You can specify era-based dates in several SQL statements.
These SQL statements might specify DATE and DATETIME column values:
- The WHERE clause of the DELETE statement
- The VALUES clause of the INSERT or MERGE statement
- The SET clause of the UPDATE or MERGE statement
When you specify a DATE column value in one of the preceding SQL
statements, the database server uses the GL_DATE (or DBDATE)
environment variable to interpret the date expression, as follows:
- If you have set GL_DATE (or DBDATE) to an era-based (Asian) date format, you can use era-based date formats for date expressions.
- If you have not set the GL_DATE (or DBDATE) environment variable to an era-based date format, you can use era-based date formats for date expressions only if the server-processing locale supports era-based dates. For more information about the server-processing locale, see Determine the server-processing locale.
- If your locale does not support era-based dates, you cannot use era-based date formats for date expressions. If you attempt to specify an era-based date format in this case, the SQL statement fails.
When you specify a DATETIME column value, the database server uses the GL_DATETIME (or DBTIME) environment variable instead of the GL_DATE (or DBDATE) environment variable to interpret the expression.
For more information, see Era-based date and time formats.