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 » gYear Problem

Post new topic  Reply to topic
 gYear Problem « View previous topic :: View next topic » 
Author Message
prabhu1950
PostPosted: Wed Jul 07, 2004 7:01 am    Post subject: gYear Problem Reply with quote

Novice

Joined: 27 May 2004
Posts: 10

Hi Everybody,

My Output message consists of a field called VehicleModelYearDate of xsd:gYear type that accepts a value in CCYY format. The input value for this field is retrieved from a corresponding DB2 Database table field - xxxx_AUTO_YR is of CHARACTER type and the length is 2. So I can get only a 2-digit year value from the query. I have a difficulty to pass this value to the output message field. I have tried a few different possibilities but in vain. I even tried to append Century values like '19', '20' to the database value before passing it to the message field. I got an error like
------
Error casting character string '' to a date.

The character string had the value ''. A character string must have the form 'DATE 'yyyy-mm-dd'', or 'yyyy-mm-dd' for it to be castable to a date.

Ensure that the string being cast has a valid value.
------
Can anyone please help me in finding the solution for this.

Thanks,

Prabhu
Back to top
View user's profile Send private message
fjcarretero
PostPosted: Wed Jul 07, 2004 7:33 am    Post subject: Reply with quote

Voyager

Joined: 13 Oct 2003
Posts: 88

Prabhu,

You will need to assign 'VehicleModelYearDate' to an entire date format

Something like:

Code:

SET path.VehicleModelYearDate = '20' || xxxx_AUTO_YR  || '-01-01'


In the OutputNode it will be converted to CCYY format.

Hope this helps

Cheers
Felipe
Back to top
View user's profile Send private message
prabhu1950
PostPosted: Wed Jul 07, 2004 11:43 am    Post subject: gYear Problem Reply with quote

Novice

Joined: 27 May 2004
Posts: 10

Hi Felipe,

Thanks for your quick reply. I tried your option. Still I got this Error.

Error casting character string '20-01-01' to a date.

The character string had the value '20-01-01'. A character string must have the form 'DATE 'yyyy-mm-dd'', or 'yyyy-mm-dd' for it to be castable to a date.

Ensure that the string being cast has a valid value.

Then I modified your code a little bit and applied. It worked!! The code I applied is,

SET path.VehicleModelYearDate = CAST('20'||TRIM(xxxx_AUTO_YR) AS DATE);

Many thanks for your advice,

Prabhu
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 » gYear Problem
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.