8.3.2. ASCII_VAL()

Available in

DSQL, PSQL

Possible name conflict

YES → Read details

Syntax

  1. ASCII_VAL (ch)
Table 124. ASCII_VAL Function Parameter
ParameterDescription

ch

A string of the [VAR]CHAR data type or a text BLOB with the maximum size of 32,767 bytes

Result type

SMALLINT

Description

Returns the ASCII code of the character passed in.

  • If the argument is a string with more than one character, the ASCII code of the first character is returned.

  • If the argument is an empty string, 0 is returned.

  • If the argument is NULL, NULL is returned.

  • If the first character of the argument string is multi-byte, an error is raised. (A bug in Firebird 2.1 - 2.1.3 and 2.5.0 causes an error to be raised if any character in the string is multi-byte. This is fixed in versions 2.1.4 and 2.5.1.)