ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Is emtpy Value, valid for a Date Datatype in ESQL?

Post new topic  Reply to topic
 Is emtpy Value, valid for a Date Datatype in ESQL? « View previous topic :: View next topic » 
Author Message
dprogwmb
PostPosted: Tue Jun 05, 2012 2:37 pm    Post subject: Is emtpy Value, valid for a Date Datatype in ESQL? Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Jun 05, 2012 2:47 pm    Post subject: Re: Is emtpy Value, valid for a Date Datatype in ESQL? Reply with quote

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.

Code:
<FIELDDATA/>


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
View user's profile Send private message
cociu_2012
PostPosted: Wed Jun 06, 2012 12:14 am    Post subject: Re: Is emtpy Value, valid for a Date Datatype in ESQL? Reply with quote

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
Code:
AND LENGTH > 0
. 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
View user's profile Send private message
kimbert
PostPosted: Wed Jun 06, 2012 1:20 am    Post subject: Reply with quote

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
View user's profile Send private message
dprogwmb
PostPosted: Thu Jun 07, 2012 6:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
kimbert
PostPosted: Fri Jun 08, 2012 12:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Is emtpy Value, valid for a Date Datatype in ESQL?
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.