Author |
Message
|
vickas |
Posted: Wed Nov 13, 2013 3:49 am Post subject: convert a character into integer using ESQL |
|
|
Centurion
Joined: 18 Aug 2013 Posts: 126
|
Is it possible to convert a character into INTEGER ?
I have tried some scenarios ,one od them includes BLOB --> CHAR --> INT , even this didnt work ...
Is there any one who can help me out !! |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Nov 13, 2013 4:02 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Why don't you show us what you have tried?
I am assuming that you are checking the data before trying the conversion as well. You need to check that it contains only 0-9, +, -
Easy to do though. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
dogorsy |
Posted: Wed Nov 13, 2013 4:12 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
Look up "Complex ESQL functions" in the infocenter |
|
Back to top |
|
 |
vickas |
Posted: Wed Nov 13, 2013 4:55 am Post subject: |
|
|
Centurion
Joined: 18 Aug 2013 Posts: 126
|
@ dogorsy , Am trying to display an ASCCI value of a character..
i.e i wanted to convert a charcter 'A' to its ascii value 65....
Is this scenario possible using ESQL in WMB ? |
|
Back to top |
|
 |
dogorsy |
Posted: Wed Nov 13, 2013 5:28 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
vickas wrote: |
@ dogorsy , Am trying to display an ASCCI value of a character..
i.e i wanted to convert a charcter 'A' to its ascii value 65....
Is this scenario possible using ESQL in WMB ? |
Yes.
IF mychar = 'A' THEN
SET OutputRoot.XMLNSC.Test.Value = '65';
END IF;
Now, if you want something more complex, you will have to work out the logic yourself, or explain the requirement better. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Nov 13, 2013 5:53 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
vickas wrote: |
@ dogorsy , Am trying to display an ASCCI value of a character..
i.e i wanted to convert a charcter 'A' to its ascii value 65....
Is this scenario possible using ESQL in WMB ? |
Please be aware that internally Broker uses a multi-byte character set namely UNICODE. This is a long-long way from US-ASCII (don't get me started on 7-bit Ascii) or even the ISO-LATIN character sets.
What you see now might not be what you see in the future? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Nov 13, 2013 6:12 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Am trying to display an ASCCI value of a character.. |
There is a reason why you want to do this. What is it? _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
|