FirebirdSQL logo

ASCII_CHAR()

Character from ASCII code

Result type

CHAR(1) CHARACTER SET NONE

Syntax
ASCII_CHAR (code)
Table 1. ASCII_CHAR Function Parameter
Parameter Description

code

An integer within the range from 0 to 255

Returns the ASCII character corresponding to the number passed in the argument.

Important
  • If you are used to the behaviour of the ASCII_CHAR UDF, which returns an empty string if the argument is 0, please notice that the internal function returns a character with ASCII code 0 (character NUL) here.

HEX_DECODE()

Decode a hexadecimal string to binary

Result type

VARBINARY or BLOB

Syntax
HEX_DECODE (hex_data)
Table 1. HEX_DECODE Function Parameter
Parameter Description

hex_data

Hex encoded data

HEX_DECODE decodes a string with hex-encoded data, and returns the decoded value as VARBINARY or BLOB as appropriate for the input.If the length of the type of hex_data is not a multiple of 2, an error is raised at prepare time.If the length of the value of hex_data is not a multiple of 2, an error is raised at execution time.

When the input is not BLOB, the length of the resulting type is calculated as type_length / 2, where type_length is the maximum length in characters of the input type.