Firebird Documentation IndexFirebird 2.1 Language Ref. UpdateInternal functions → ASCII_VAL()
Firebird Home Firebird Home Prev: ASCII_CHAR()Firebird Documentation IndexUp: Internal functionsNext: ASIN()

ASCII_VAL()

Tip

Find a more recent version at Firebird 5.0 Language Reference: ASCII_VAL()

Available in: DSQL, PSQL

Added in: 2.1

Description: Returns the ASCII code of the character passed in.

Result type: SMALLINT

Syntax: 

ASCII_VAL (ch)

ch  ::=  a [VAR]CHAR or text BLOB of max. 32767 bytes
  • 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 causes an error to be raised if any character in the string is multi-byte. This is fixed in 2.1.4.)

Important

If the external function ASCII_VAL is declared in your database, it will override the internal function. To make the internal function available, DROP or ALTER the external function (UDF).

Prev: ASCII_CHAR()Firebird Documentation IndexUp: Internal functionsNext: ASIN()
Firebird Documentation IndexFirebird 2.1 Language Ref. UpdateInternal functions → ASCII_VAL()