|Products | Download | Buy | About Us|
|Connect XML-2-DB User's Guide|
5(f). Date and Time formats
When a value has to be inserted into a database column that has a date/time data type, (date for Oracle, datetime and smalldatetime for SQL Server) the format of the date value has to be specified in order to correctly interpret the date value. For example, 2/10/2000 and 10/2/2000 could both be interpreted as Feb 10, 2002 or as October 2, 2002.
The <map> element has an optional attribute, source-datetime-format, which can be used to specify the format that the date value will have in the XML data file.
Then mapping rules to to do this would be as follows:
<!-- Oracle example --> <map element-name="software-sale" attribute-name="purchase-date" table-reference="SoftwareSales" column-name="PURCHASE_DATE" source-datetime-format="MM-DD-YYYY"> </map> <map element-name="software" attribute-name="release-date" table-reference="BillingSoftware" column-name="RELEASE_DATE" source-datetime-format="MM/dd/yyyy"> </map>
Other examples of date formats are provided in the table below:
|Copyright © Skyhawk
Systems. All Rights Reserved.
Send comments and questions to email@example.com.