|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
gYear Problem |
« View previous topic :: View next topic » |
Author |
Message
|
prabhu1950 |
Posted: Wed Jul 07, 2004 7:01 am Post subject: gYear Problem |
|
|
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 |
|
 |
fjcarretero |
Posted: Wed Jul 07, 2004 7:33 am Post subject: |
|
|
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 |
|
 |
prabhu1950 |
Posted: Wed Jul 07, 2004 11:43 am Post subject: gYear Problem |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|