|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Is emtpy Value, valid for a Date Datatype in ESQL? |
« View previous topic :: View next topic » |
Author |
Message
|
dprogwmb |
Posted: Tue Jun 05, 2012 2:37 pm Post subject: Is emtpy Value, valid for a Date Datatype in ESQL? |
|
|
Voyager
Joined: 19 Jul 2011 Posts: 96
|
Hi all
I've an xsd:date field, that is in a incoming message, but it's optional... but the application that sends that field sometimes send it but with no value ... for example <FIELDDATA></FIELDDATA> , and It throws an exception that the Broker can't convert from Date DataType to Character...
So I'd like to ask you, if somebody know if a empty value for a field defined as xsd:date is valid?
Or how can I determine, if a field with a dataType of Date, is valid in ESQL?
I was using:
Code: |
IF FIELDVALUE(FIELDATE) IS NOT NULL THEN
ELSE
END IF; |
But I'm getting the same Error: that the Broker can't convert from Date DataType to Character.
Regards.
Any ideas? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 05, 2012 2:47 pm Post subject: Re: Is emtpy Value, valid for a Date Datatype in ESQL? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dprogwmb wrote: |
Any ideas? |
The construction:
Code: |
<FIELDDATA></FIELDDATA> |
is not null, it's blank.
is null.
If you want to validate a date I'd consider a CAST with the proper FORMAT and a DEFAULT. If you get the default, it's not a date. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
cociu_2012 |
Posted: Wed Jun 06, 2012 12:14 am Post subject: Re: Is emtpy Value, valid for a Date Datatype in ESQL? |
|
|
Acolyte
Joined: 06 Jan 2012 Posts: 72
|
dprogwmb wrote: |
Or how can I determine, if a field with a dataType of Date, is valid in ESQL?
|
I don't believe there is an standart function to validate a field in ESQL. There is a validation node, or validation tab on input nodes for that. Why not use it?
On the other hand, CAST will do that. If the format is not valid, will throw an exception. That's your validation.
dprogwmb wrote: |
I was using:
Code: |
IF FIELDVALUE(FIELDATE) IS NOT NULL THEN
ELSE
END IF; |
|
You can add
. This is when you have EMPTY and NOT NULL. But this will not isolate the situation when you'll have an invalid date format. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 06, 2012 1:20 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
It throws an exception that the Broker can't convert from Date DataType to Character |
Which parser are you using? MRM or XMLNSC? |
|
Back to top |
|
 |
dprogwmb |
Posted: Thu Jun 07, 2012 6:03 pm Post subject: |
|
|
Voyager
Joined: 19 Jul 2011 Posts: 96
|
kimbert wrote: |
Quote: |
It throws an exception that the Broker can't convert from Date DataType to Character |
Which parser are you using? MRM or XMLNSC? |
The MRM parser, but using the xmlnsc the problem was solved  |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jun 08, 2012 12:50 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
dprogwmb said:
Quote: |
The MRM parser, but using the xmlnsc the problem was solved |
Lesson learned, then?
I would be interested to know exactly *how* the problem was solved. The question about ESQL DATETIME type did not seem relevant to me; your dateTime value ( empty string ) is not valid for XML Schema type xs:dateTime. Even if the MRM parser had allowed it, your dateTime value would have been invalid in other XML processing applications. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|