View previous topic :: View next topic
|
Author |
Message |
daga.aditya
New User
Joined: 30 Jun 2010 Posts: 9 Location: noida
|
|
|
|
Hi,
I want to comapre two different Hex values. Can someone please help on this.
Thanks.
Aditya... |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I'm sure someone can, if you give sufficient information for someone to do so.
Show us what you are trying, and the problem you have. With what you've provided so far, we haven't a clue. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
I would recommend using the IF statement. Further than that, however, would depend upon details you did not provide. |
|
Back to top |
|
|
daga.aditya
New User
Joined: 30 Jun 2010 Posts: 9 Location: noida
|
|
|
|
Actually i have a correlation id which is coming from powerbuilder. Whenever this correlation id has Hex values such as '9F' it gets converted to '3f' at the time db2 insertion since db2 doesnot support these values.
Solution i am trying to implement is i will compare the correlation id sent initially by PB and the one inserted in Db2. if there is a difference then i will use the one sent by PB.
Hope this helps.
Thanks.
Aditya. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
if You already know that the values are different no need to compare them
apart pulling Your leg
remember that everything is hex inside a <cpu>
the difference is on how to interpret it
x'0c' ==> packed decimal 0
x'0c' ==> binary equivalent of a decimal 12 ( signed or unsigned )
x'F1' ==> char "1"
x'F1' ==> unsigned binary for decimal 241
x'F1' ==> signed binary for -15 ( unless I made a silly mistake )
so hex value is a pretty meaningless definition |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
If A = B, use B
else use A |
is the same as
I don't understand the "not support" part. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
daga.aditya wrote: |
A Whenever this correlation id has Hex values such as '9F' it gets converted to '3f' at the time db2 insertion since db2 doesnot support these values. |
What is the definition of the column in DB2 that you are trying to insert this mystery char into, if it is char or varchar DB2 will accept any of the 256 possible values that a byte can contain. |
|
Back to top |
|
|
|