[resolved] Problem inserting dateTime into MDM entity

One Star

[resolved] Problem inserting dateTime into MDM entity

Hi,
I'm a newbie to talend and java. I'm stuck with a problem.
I need to insert data into MDM from a MySQL database. So, I have a tMysqlInput component reading rows from a MySQL database. The latter component is linked to a tMap component to transform data which is then sent to a tMDMOutput component for inserting data into the MDM.
I have having problems with dateTime values. The field dte_cre of type datetime in MySQL database. Its contents has to be mapped to the field dteCreation of type dateTime in the MDM. The field in the tMap component corresponding to dteCreation is of type Date and date model "dd-MM-yyyy HH:mm:ss".
When I execute the job, I get the following error :
      :-1:-1: cvc-datatype-valid.1.2.1: '06-01-2015 10:04:50' is not a valid value for 'dateTime'.
      :-1:-1: cvc-type.3.1.3: The value '06-01-2015 10:04:50' of element 'dteCreation' is not valid.
I don't understand why I'm getting this error. The value looks very much like a dateTime to me.
Can anybody help me please ?
Thanks.

Accepted Solutions
Employee

Re: [resolved] Problem inserting dateTime into MDM entity

Hi,
As explained in http://www.w3.org/TR/xmlschema-2/, the date time format for a xsd:datetime is "yyyy-MM-dd'T'HH:mm:ss". It looks like:

you're missing the 'T' separator between the date and the time.
the date part does not follow "yyyy-MM-dd" format (should be "2015-01-06").

Thanks.

All Replies
Employee

Re: [resolved] Problem inserting dateTime into MDM entity

Hi,
As explained in http://www.w3.org/TR/xmlschema-2/, the date time format for a xsd:datetime is "yyyy-MM-dd'T'HH:mm:ss". It looks like:

you're missing the 'T' separator between the date and the time.
the date part does not follow "yyyy-MM-dd" format (should be "2015-01-06").

Thanks.
One Star

Re: [resolved] Problem inserting dateTime into MDM entity

Hi,
Thanks a lot for your reply.
It's working now.
Sheila