Entering date and time values with QMF

By default, or if the DSQSFISO program parameter is set to YES, QMF application programs are precompiled with the date and time formats of the International Standards Organization (ISO), which represents dates as yyyy-mm-dd and times as hh.mm.ss.

For the default situation, , if you insert a date or time value into a character column using a special register such as CURRENT DATE or CURRENT TIME, the character-string representation of the value is in the ISO format.

To insert the value in a format other than ISO (such as EUR format), you can use a statement like this:
   INSERT INTO date_table
     SELECT CHAR(CURRENT DATE, EUR)
     FROM any_table
     WHERE any_table.unique_column = 'unique_value'

In this statement, date_table is the name of the table into which you want to insert the current date value, any_table is any table (preferably not one that is subject to changes) with a column that contains unique values, and 'unique_value' is a value of the unique column. In these examples, date_table has one character column, which contains the character representation of a date value.

To insert the default format, you can enter an SQL statement like the following:
   INSERT INTO date_table
     VALUES(CURRENT DATE)
To update a character column with the CURRENT DATE or CURRENT TIME value in a format other than ISO, use a statement such as the following:
   UPDATE date_table
     SET date_column = CHAR(CURRENT DATE, EUR)
     WHERE (clause identifying row to be updated)

In this statement, date_column is a column defined with the DATE data type.

This behavior may be changed within a QMF session by setting the DSQEC_DSQSFISO global variable. Changing DSQEC_DSQSFISO to '0' will format CHAR(datetime-expression) in the format that is specified in the DATE FORMAT and TIME FORMAT fields on Db2 installation panel DSNTIP4. To determine the DATE FORMAT and TIME FORMAT values defined in the current Db2 subsystem, reference the DSQAO_DATE_FORMAT and DSQAO_TIME_FORMAT global variables.