RE: Re: how do you convert from hex to integer using SQL ?
Posted in 2005
Sebastian, Norma J. said:
>
> Rajib,
>
> I played with your sql: "select '0xa' + 0 from systables where tabid =
> 1;" ... "It'll print the integer value of the hex"
>
> I ran this:
> select tabname, partnum,
> hex(partnum), ('0xa' + hex(partnum))
> from systables
0xa != 0 :o)
> I get results like:
>
> tabname ebkpf (SAP table names...)
> partnum 62914738
> (expression) 0x03C000B2
> (expression) 62914748.0000000
>
> tabname syschecks
> partnum 1048716
> (expression) 0x0010008C
> (expression) 1048726.00000000
>
> tabname syscoldepend
> partnum 1048718
> (expression) 0x0010008E
> (expression) 1048728.00000000
>
>
> Shouldn't the partnum and the second expression be equal based on your
> suggestion, or am I doing something wrong?
> Thanks,
> Norma Jean
>
>
>
> -----Original Message-----
> From: Rajib Sarkar <rsarkar@us.ibm.com>
> To: darren.edgerton@reece.com.au
> Date: Wed, 5 Jan 2005 13:00:28 -0700
> Subject: Re: how do you convert from hex to integer using SQL ?
>
> Its pretty simple actually ..:-)
> u can try something like:
> select '0xa' + 0 from systables where tabid = 1;
> It'll print the integer value of the hex. U can substitute ur column
> instead of the hard-coded value in the example.
> Thanx much,
>
> Rajib Sarkar
> Advisory Software Engineer
> DB2/UDB Regional Advanced Support
> IBM Data Management Group
>
>
>
> darren.edgerton@r
>
> eece.com.au
>
> Sent by:
> To
> owner-informix-li informix-list@iiug.org
>
> st@iiug.org
> cc
>
>
>
> Subject
> 01/05/2005 12:09 how do you convert from hex to
>
> AM integer using SQL ?
>
>
>
>
>
> Please respond to
>
> darren.edgerton
>
>
>
> Hi,
> i need to conv from Hex to Integer
> can this be done using SQL with Informix ??
> Ie
> select integer(hex_data_column) from mytable
> thanks,
> ============================================================
> The information contained in this message may be privileged
> and confidential and protected from disclosure. If the reader
> of this message is not the intended recipient, or an employee
> or agent responsible for delivering this message to the
> intended recipient, you are hereby notified that any reproduction,
> dissemination or distribution of this communication is strictly
> prohibited. If you have received this communication in error,
> please notify us immediately by replying to the message and
> deleting it from your computer. Thank you. Tellabs
> ============================================================
>
> sending to informix-list
>
--
Bye now,
Obnoxio
"C'est pas parce qu'on n'a rien ' dire qu'il faut fermer sa gueule"
- Coluche
"I'm trying to see things your way, but I can't get my head up my ass"
- JCH
"Ogni uomo mi guarda come se fossi una testa di cazzo"
- Marco
I went to the airport to check in and they asked what I did because I
looked like a terrorist. I said I was a comedian. They said, "Say
something funny then." I told them I had just graduated from flying
school.
-- Ahmed Ahmed
sending to informix-list