ASCII Function [String]

Returns the integer ASCII value of the first byte in a string-expression.

Syntax

ASCIIstring-expression )

Parameters

Parameters

Parameter

Description

string-expression

The string.

Returns

SMALLINT

Example

The following statement returns the value 90, when the collation sequence is set to the default ISO_BINENG:

SELECT ASCII( 'Z' ) FROM iq_dummy

Usage

If the string is empty, ASCII returns zero. Literal strings must be enclosed in quotes.

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Compatible with Adaptive Server Enterprise.