Previous Topic Next topic Print topic


DETECTDATE

Enables recognition of date, time and datetime values in character host variables.

Syntax:

[NO]DETECTDATE

Properties:

Default: NODETECTDATE

Scope:

Used at compile time: Yes
Behavior at run time: OpenESQL - Process

HCOSS - Source file

See Scope - OpenESQL SQL Compiler Directive Options and Scope - HCOSS SQL Compiler Directive Options for more information.

Comments:

When using DETECTDATE with the HCOSS DATE or TIME directive, it converts values that match DB2 formats to SQL Server-compatible formats.

The following comments apply to DETECTDATE as a generic SQL compiler directive, that is, not in the context of HCO for SQL Server (HCOSS):
  • Use DETECTDATE if your server does not have a suitable native character string date representation (for example, Microsoft Access). It is also useful for generic applications.
  • DETECTDATE identifies the following escape sequences:
    • {dData} - date
    • {tData} - time
    • {tsData} - timestamp
  • Once identified, DETECTDATE binds the host variables as date, time, and timestamp columns as appropriate instead of binding them as character columns.
  • The use of DETECTDATE can cause problems if your database contains character columns not related to date or time data that can legitimately contain data that starts with {d, {t or {ts.
Previous Topic Next topic Print topic