show hex value

40 views
Skip to first unread message

mche...@gmail.com

unread,
Dec 31, 2022, 1:17:14 PM12/31/22
to H2 Database
hi
   possible to show show hex value from select?
thanks
Peter

Evgenij Ryazanov

unread,
Jan 4, 2023, 3:55:47 AM1/4/23
to H2 Database
Hi!

H2 Console already displays values of binary strings in hexadecimal format, if you need a similar feature in other tool you should ask its developers instead.

There is also a RAWTOHEX function, you can use it to convert a binary string to a character string with hexadecimal representation.

mche...@gmail.com

unread,
Jan 21, 2023, 12:21:43 PM1/21/23
to H2 Database
hi , possible to show an integer in hex format?

Andreas Reichel

unread,
Jan 21, 2023, 8:17:08 PM1/21/23
to h2-da...@googlegroups.com
Greetings.

On Sat, 2023-01-21 at 09:21 -0800, mche...@gmail.com wrote:
hi , possible to show an integer in hex format?

As far as I understand you can define your own Functions in H2, using Java language.
This should do the trick.

Cheers
Andreas

Evgenij Ryazanov

unread,
Jan 21, 2023, 9:01:17 PM1/21/23
to H2 Database
Hello!

There is a RAWTOHEX function, you can convert this integer number to a BINARY(4) data type and pass the result to this function:
SELECT RAWTOHEX(CAST(1234567890 AS BINARY(4)));

mche...@gmail.com

unread,
Jan 22, 2023, 4:04:55 AM1/22/23
to H2 Database
thank you sir
Reply all
Reply to author
Forward
0 new messages