Allows datetime values for PIC X character input host variables in a mainframe DB2 application to be in different formats
than those supported by SQL Server.
Restriction: This topic applies to Windows environments only.
Restriction: This topic applies to DETECTDATE as an HCOSS SQL compiler directive option only. For information on using the OpenESQL DETECTDATE
SQL compiler directive option, see
DETECTDATE under
SQL Compiler Directive Options.
DETECTDATE enables you to specify alternative formats for input host variables. HCOSS manages the translation between the
format specified by DETECTDATE and the format recognized by SQL Server. This is done for each SQL call on both input and output.
For example, SQL Server supports formatted values for datetime fields as cited in
HCOSS Datetime Data Type Handling. For a mainframe DB2 application that uses datetime formats, such as EUR, that are not supported by SQL Server, with DETECTDATE
you can still run it against a SQL Server database keeping the EUR datetime formats intact even though the SQL Server database
does not accept those formats.
Important: Use DETECTDATE with extreme caution and only when absolutely necessary. Before using DETECTDATE, carefully review all options
specified here, all of the information presented in
HCOSS Datetime Data Type Handling, and the information in the
DATE and
TIME topics to help you determine the best fit for your application.
Syntax:
[NO]DETECTDATE
DETECTDATE={CLIENT | SQLTYPE | SERVER | PICX}
Parameters:
- CLIENT
- Applies to DBMAN=ODBC only.
- Input Host Variables
- For PIC X character input host variables, HCOSS recognizes specified datetime formats and translates the data into a format
acceptable to SQL Server for processing. Specified datetime formats for input host variables are:
- Date
- Mainframe default, can be overridden by specifying the DATE HCOSS directive.
- Time
- Mainframe default, can be overridden by specifying the TIME HCOSS directive.
- Timestamp
-
- yyyy-mm-dd-hh.mm.ss.ffffff
- yyyy-mm-dd hh.mm.ss.ffffff
- yyyy-mm-dd hh:mm:ss.ffffff
- yyyy-mm-ddThh.mm.ss.ffffff
- yyyy-mm-ddThh:mm:ss.ffffff
- Output Host Variables
- For PIC X as well as SQLTYPE output character host variables, HCOSS returns the data for output host variables in the following
datetime formats:
- Date
- Mainframe default, can be overridden by specifying the DATE HCOSS directive.
- Time
- Mainframe default, can be overridden by specifying the TIME HCOSS directive.
- Timestamp
- yyyy-mm-dd-hh.mm.ss.ffffff
- SQLTYPE
-
Note: Deprecated feature starting with
Enterprise Developer version 2.3, and provided for backward compatibility only. Datetime processing of SQLTYPE host variables is now independent
of DETECTDATE.
Applies to DBMAN=ODBC only. Processing is identical to the CLIENT option, but applies only to SQLTYPE host variables and not PIC X.
- SERVER
- Applies to DBMAN=ODBC only.
Issues SQLDescribeParam calls to the DBMS to identify which input and output host variables are associated with specific character
or datetime columns in the database. Host variables associated with datetime columns are translated with the datetime formats
listed in CLIENT. Character columns are not translated.
- PICX
- Identical to the CLIENT option. Provided for backward compatibility.
Properties:
Defaults:
|
When DETECTDATE is not specified, the default is: NODETECTDATE
When DETECTDATE with no argument is specified, the default is: DETECTDATE=CLIENT
|
Scope:
Used at compile time:
|
Yes
|
Behavior at run time:
|
Source file
|
See
Scope - HCOSS SQL Compiler Directive Options for more information.