|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Invalid character error in message flow when casting value.. |
« View previous topic :: View next topic » |
Author |
Message
|
tucanen |
Posted: Sat Sep 10, 2005 4:20 pm Post subject: Invalid character error in message flow when casting value.. |
|
|
Novice
Joined: 27 Jun 2005 Posts: 22 Location: Sweden
|
Hi,
My message flow queries an Oracle 9.2.0 database (odbc data source) for some information. One of the columns in the SQL select statement is of the data type NUMBER in the oracle database.
When the query returns the value -1,6648E+2 and I try to the following, it fails with a bip2592 error (Invalid Characters):
myVar = CAST(myRes.a As DECIMAL(16,4));
When I try the same SQL statement in SQLPlus, it returns the value -166,48.
Does anyone have a clue about how to solve this problem?
I have tried putting a TO_CHAR and TO_NUMBER conversion in the SQL statement, but it made difference...
WBIMB 5.0 and Oracle 9.2.0 running on Win XP.
Regards,
contact admin |
|
Back to top |
|
 |
javaforvivek |
Posted: Sun Sep 11, 2005 9:34 pm Post subject: |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
Hi,
I guess that it's due to the comma (-166,4 in the value that is returned by your select statement:
tucanen wrote:
Quote: |
When I try the same SQL statement in SQLPlus, it returns the value -166,48.
|
Try to replace the comma(,) with period(.) so that your value looks like
-166.48. Then try to cast it to decimal. _________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
Back to top |
|
 |
tucanen |
Posted: Tue Sep 13, 2005 9:16 am Post subject: |
|
|
Novice
Joined: 27 Jun 2005 Posts: 22 Location: Sweden
|
Hi,
Thank you for helping!
Actually, I solved it by doing the following to_char conversation in the select statement:
TO_CHAR( myTable.myColumn, 'FM9999999999990.0000' )
So you were right
Thanks.
/ contact admin |
|
Back to top |
|
 |
javaforvivek |
Posted: Tue Sep 13, 2005 8:54 pm Post subject: |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
Can you please post the query? Which database you are using? Did you use PASSTHRU to fire the SELECT query or you did it through ESQL code? _________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
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
|
|
|
|