XMLTODATABASE: Format date and numeric values

It’s possible to change to date and numeric format used in the form data XML file when inserting values in the database.

You can use XMLTODATABASE action parameters to define the culture to use to format the date and numeric values. See Date and numeric field formatting in the WorkflowGen Administration Guide for details.

Using the following parameters, you can specify which fields have to be formatted as date or numeric values:

  • XML_FIELDS_DATE: List of date type fields

  • XML_FIELDS_NUMERIC: List of numeric type fields

  • XML_LOCALE: Culture code to use to format the date and numeric values (e.g. en-GB or en-US)

The XML_FIELDS_DATE and XML_FIELDS_NUMERIC parameters must contain a list of XPath expressions separated by , (comma) characters.

Date format generated into the SQL queries

The DATE type fields are formatted as follows: yyyy-mm-dd hh:MM:ss

Numericformat generated into the SQL queries

The numeric fields are formatted as follow: XXXX.XX

Example

Rule: All of the nodes found in the XML document with the name REQUEST_DATE and the specific node situated at /MyData/MyExample/Date_Field will be formatted as date.

Method: XML_FIELDS_DATE = //*/REQUEST_DATE, /MyData/MyExample/Date_Field

Important:

In the Form Designer, you have to set the format of numeric and datetime fields accordingly (numeric or datetime). For Visual Studio web forms you have to set the fielddatatype attribute to Numeric or Datetime.