Restrictions on the use of local datetime formats

When you use a LOCAL format for date or time values, certain restrictions apply to the use of those values as input, as output, and for use in binding a package.

The following rules apply to the character-string representation of dates and times:

For input: In distributed operations, Db2 as a server uses its local date or time routine to evaluate host variables and constants. This means that character-string representation of dates and times can be:

  • One of the standard formats
  • A format recognized by the server's local date/time exit

For output: With DRDA access, Db2 as a server returns date and time host variables in the format defined at the server. To have date and time host variables returned in another format, use CHAR(date-expression, XXXX) where XXXX is JIS, EUR, USA, ISO, or LOCAL to explicitly specify the specific format.

For BIND PACKAGE COPY: When you use the COPY option to bind a copy of a local package at a remote site, Db2 uses the ISO format for output values in the remote package unless the SQL statement explicitly specifies a different format. Input values can be specified in the format described previously.

Start of changeFor remote bind operations that originate from Db2: The default format is determined by the installation defaults of the Db2 subsystem from which the BIND command was issued.End of change