Author |
Message
|
kirankinnu |
Posted: Wed Sep 26, 2007 1:01 pm Post subject: Conversion from Char to DECIMAL |
|
|
 Centurion
Joined: 12 Jun 2004 Posts: 128 Location: Chicago, IL
|
I am using WMB V6
I am trying to convert from Char to DECIMAL
I am using this statement CAST(tt AS DECIMAL(4,2)); to convert from char tt to decimal. When I look at the code in debug mode, At this point, the broker is hunging up and I am getting disconnected from debug mode. What might be the reason.
Thank You,
Kiran |
|
Back to top |
|
 |
kirankinnu |
Posted: Wed Sep 26, 2007 1:20 pm Post subject: |
|
|
 Centurion
Joined: 12 Jun 2004 Posts: 128 Location: Chicago, IL
|
When I looked at the logs I could see this message
The Java API framework could not create an instance of 'BigDecimal'.
What does this mean. Do I need to install any fixpacs.
Thank you,
Kiran |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 26, 2007 2:26 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried using the format clause in conjunction with your CAST?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kirankinnu |
Posted: Thu Sep 27, 2007 5:56 am Post subject: |
|
|
 Centurion
Joined: 12 Jun 2004 Posts: 128 Location: Chicago, IL
|
I think the FORMAT clause is doing the work. But I was wondering why the previous statement is not working.
1 more quick question,
For example I have the input format as 2345, what format should I give to get the output format as 23.45
Thanks Again
Kiran |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 27, 2007 6:17 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
kirankinnu wrote: |
I think the FORMAT clause is doing the work. But I was wondering why the previous statement is not working. |
There is no format clause on the previous statement, there is only a precision.
1 more quick question,
kirankinnu wrote: |
For example I have the input format as 2345, what format should I give to get the output format as 23.45 |
The format clause that specifies that the string input consists of two digits and a virtual decimal of two places. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kirankinnu |
Posted: Thu Sep 27, 2007 6:37 am Post subject: |
|
|
 Centurion
Joined: 12 Jun 2004 Posts: 128 Location: Chicago, IL
|
The problem over here is I am gettting the data as Char from Msgset (I cannot change the msgset) and Now I have to convert the Char to DECIMAL using the esql code. Is there a way to mention the virtual decimal in the ESQL.
Thank You,
Kiran |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 27, 2007 6:39 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
kirankinnu wrote: |
Is there a way to mention the virtual decimal in the ESQL. |
If I had to know the answer to this question, I would go look up the reference on the ESQL CAST statement in the Info Center. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|