|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to convert CHAR '02' to Integer |
« View previous topic :: View next topic » |
Author |
Message
|
N |
Posted: Sun Feb 24, 2008 5:52 pm Post subject: How to convert CHAR '02' to Integer |
|
|
Acolyte
Joined: 21 Jul 2007 Posts: 64
|
Hi,
Any1 have tried to convert CHAR '02' to INT 2? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 25, 2008 1:21 am Post subject: Re: How to convert CHAR '02' to Integer |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
N wrote: |
Any1 have tried to convert CHAR '02' to INT 2? |
Yes thanks!
What method did you try? I'm saying try, because I doubt you'd have posted if it worked.
Of course, if you're just judging support for a "we successfully converted char to int club" I apologise.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
N |
Posted: Mon Feb 25, 2008 10:18 pm Post subject: |
|
|
Acolyte
Joined: 21 Jul 2007 Posts: 64
|
Hi,
Thanks for your reply. I got it works before i post. However im jz wondering is there any better solution?
DECLARE X CHAR;
SET X='02';
DECLARE Y INTEGER;
SET Y = CAST(X AS INTEGER); -- Print 2 |
|
Back to top |
|
 |
AkankshA |
Posted: Tue Feb 26, 2008 2:12 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
N wrote: |
Hi,
Thanks for your reply. I got it works before i post. However im jz wondering is there any better solution?
DECLARE X CHAR;
SET X='02';
DECLARE Y INTEGER;
SET Y = CAST(X AS INTEGER); -- Print 2 |
better solution in terms of ??
this is the simplest and most perfomant possible solution... _________________ Cheers |
|
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
|
|
|
|