mysql_hex_string
mysql_hex_string converts a binary buffer to a hex-encoded string for safe embedding in SQL; the output buffer must be at least 2*length+1 bytes.
Syntax
unsigned long mysql_hex_string(char * to,
const char * from,
unsigned long len);Parameters
to- result bufferfrom- the string which will be encodedlen- length of the string (from)
Description
This function is used to create a hexadecimal string which can be used in SQL statements. e.g. INSERT INTO my_blob VALUES(X'A0E1CD').
Return Value
Returns the length of the encoded string without the trailing null character.
See Also
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

