Standards and
compatibility
See also
CHAR function [String]
Function
Syntax
Parameters
Examples
Usage
Standards and
compatibility
CHARINDEX function [String]
Function
Syntax
Parameters
Examples
♦
Vendor extension.
SQL/92
♦
Sybase
Compatible with Adaptive Server Enterprise.
"FLOOR function" on page 338
Returns the character with the ASCII value of a number.
CHAR ( integer-expression )
integer expression
The number to be converted to an ASCII character.
The number must be in the range 0 to 255, inclusive.
The following statement returns the value Y.
SELECT CHAR( 89 )
The character returned corresponds to the supplied numeric expression in the
current database character set, according to a binary sort order.
CHAR returns NULL for integer expressions with values greater than 255 or
less than zero.
♦
SQL/92
Vendor extension.
♦
Compatible with Adaptive Server Enterprise.
Sybase
Returns the position of one string in another.
CHARINDEX ( string-expression1, string-expression2 )
string expression1
The string you are searching for.
string expression2
The string to be searched.
The statement
SELECT emp_lname, emp_fname
FROM employee
WHERE CHARINDEX('K', emp_lname ) = 1
returns the following values:
Chapter 8 SQL Functions
319
Need help?
Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?
Questions and answers