This is a read-only copy of the MariaDB Knowledgebase generated on 2024-12-22. For the latest, interactive version please visit https://mariadb.com/kb/.

mysql_hex_string

Syntax

unsigned long mysql_hex_string(char * to,
                               const char * from,
                               unsigned long len);
  • to - result buffer
  • from - the string which will be encoded
  • len - 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').

Returns the length of the encoded string without the trailing null character.

The size of the buffer for the encoded string must be 2 * length + 1.

The encoded string does not contain a leading X'.

See also

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.