View previous topic :: View next topic
|
Author |
Message |
PepeVil
New User
Joined: 12 Jan 2023 Posts: 2 Location: Spain
|
|
|
|
Hello,
This sentence: SELECT HEX (3882121118447824) FROM SYSIBM.SYSDUMMY1;
gets: '000DCAC4C23D78D0'.
It is possible to get the opposite, ie from '000DCAC4C23D78D0' get 3882121118447824?
Thanks |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
Did you try to Google for this?
Code: |
db2 built-in functions convert hex to decimal |
|
|
Back to top |
|
|
PepeVil
New User
Joined: 12 Jan 2023 Posts: 2 Location: Spain
|
|
|
|
Of course I have looked in Google and I have seen that adhoc functions can be built but I want to know if there was any solution in which it is not necessary to create a new function, for example, as a combination of several already existing functions.
I have tried but so far I have not succeeded. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
PepeVil wrote: |
Of course I have looked in Google and I have seen that adhoc functions can be built but I want to know if there was any solution in which it is not necessary to create a new function, for example, as a combination of several already existing functions.
I have tried but so far I have not succeeded. |
There is no standard built-in DB2 function to convert FROM HEX, because it is never required in normal SQL-related logic. It has been said clearly in multiple sources, found from Google, and others.
Those who cannot survive without this kind of conversion have created their own versions of "HEX2DEC" functions. I personally have found several examples after less than 5 minutes of googling... |
|
Back to top |
|
|
|