DATEFORMAT - connect_cdc_sqdata - Latest

Connect CDC (SQData) Apply engine

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (SQData)
Version
Latest
Language
English
Product name
Connect CDC (SQData)
Title
Connect CDC (SQData) Apply engine
Copyright
2024
First publish date
2000
ft:lastEdition
2024-07-30
ft:lastPublication
2024-07-30T20:19:56.898694

The DATEFORMAT command is used to set the format of date/time fields before updating Relational target tables.

For Oracle and SQL Server target datastores, the string value specified in the DATEFORMAT command is passed to the Oracle or SQL Server system to convert the incoming date/time value to one that Oracle or SQL Server supports. The supported date/time formats can be found in the Oracle SQL and SQL Server Reference documentation.

For DB2 target datastores, the source date value is converted to the DB2 date format based on the DATEFORMAT string value specified. The supported date/time formats can be found in the DB2 SQD Reference.

The DATEFORMAT commands can be specified on global level (i.e. no field specification) and/or a field level. Global specification applies to all relational target database tables in the script. If a global specification is used, it must precede any field level specifications, since field level DATEFORMAT commands override a previously specified global level DATEFORMAT command.

Syntax
DATEFORMAT [<field_name>] <format_string> | 'ISO'  | 'ISOIBM' ;
Keywords and Descriptions
Keyword Description
<field_name>

An optional target field name that if specified, with take on the date format. If this parameter is specified, the DATEFORMAT is considered a field level specification; otherwise it is considered a global specification.

<format_string>

The required date/time format of the target field before it is updated into Oracle, SQL Server or DB2. For Oracle and SQL Server, this string is any value for date format. The supported formats (i.e. YYYY-MM-DD) are listed in the Oracle SQL and SQL Server Reference manuals. For DB2, the format string must be one of ISO, USA, EUR, or JIS. These date formats are what DB2 allows, and based on the string specified, the resulting target field is converted accordingly.

ISO

The target will be formatted according to the following interpretation of the ISO 8601 standard 'YYYY-MM-DDTHH.MM.SS.FF6'

ISOIBM

Intended for Db2/z and Db2/LUW which substitutes a hyphen for the T separator in the ISO timestamp, 'YYYY-MM-DD-HH.MM.SS.FF6'

Example 1

Specify a DATEFORMAT for Oracle at a global level, and a field level DATEFORMAT for target column ORA_COL1 in ORA_TBL1.
DATEFORMAT 'YYYY-MM-DD HH24.MI';
DATEFORMAT ORA_TBL1.ORA_COL1 'YYYY-MM-DD HH24.MI.SS';

Example 2

Specify a global ISO date/time format for all DB2 target tables and override the date/time format for target column DB2_COL1 in table DB2_TBL1 to USA.
DATEFORMAT 'ISOIBM';
DATEFORMAT DB2_TBL1.DB2_COL1 'USA';

Example 3

Specify a DATEFORMAT for a column in a target description that has the data type TIMESTAMP.
DATEFORMAT <description>.<column_name> 'YYYY-MM-DD-HH24.MI.SS.FF6';