ASCII Function [String]

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

Syntax

ASCIIstring-expression )

Parameters

Parameter

Description

string-expression

The string.

Returns

SMALLINT

Remarks

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.

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