DataLoader/MX Reference Manual (H06.03+, J06.03+)

Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual543544-001
5-15
Data Conversion
DTLExternalToInternalDatetime
This procedure converts a character string containing a date and time to the internal
form suitable for processing by SQLCI LOAD.
The syntax is:
SQLCI LOAD/COPY require date-time data in a unique internal format. Moreover, the
conversion is complex. Therefore, this procedure is particularly useful for a user exit
doing date conversion that is eventually destined for SQLCI LOAD/COPY.
There are many external formats for dates and times, so no one conversion procedure
processes all formats. For this reason, this procedure accepts as input date and time
strings, formatted according to the same rules as apply to date-time literals in SQL/MX,
of the form:
YYYY-MM-DD:HH:MM:SS.MSSSSS
where
The input string need not contain all these fields. You need only as many contiguous
fields as are necessary to make the input unambiguous. For example, 1943-11-29 is
acceptable because it could be only YYYY-MM-DD, but 01:01 is not because the value
could be DD:HH or HH:MM or MM:SS and is therefore ambiguous.
If the input file contains a date or time in another format, convert it to the date-time
format (YYYY-MM-DD) and call this procedure to convert that to the internal format.
short DTLExternalToInternalDatetime
(
char* ExternalDateTime,
long long* InternalDateTime
);
YYYY is year, from 0001 through 9999
MM is month, from 1 or 01 through 12
DD is day, from 1 or 01 through 31
HH is hour, from 0 or 00 through 23
MM is minute, from 0 or 00 through 59
SS is second, from 0 or 00 through 59
MSSSSS is microsecond, from 0 through 999999