Table of ContentsPreviousNext

Ispirer
Please, note, that Ispirer SQLWays 6.0 is no longer supported and provided to clients.
You can try out automated conversion of databases and applications with Ispirer Toolkit for free. Download free trial.
Check out the relevant toolkit documentation.
Ispirer Database Conversion overview.


Ispirer SQLWays Database Migration Software

Converting ASCII Code to Character

This subsection describes functions, which convert an int ASCII code to a character in various databases.

TABLE 54. Converting ASCII Code to Character
Database
Syntax
Description
Oracle
CHR ( exp1 [USING 
NCHAR_CS]) 
Returns the character having the binary equivalent to exp1 in either the database character set or the national character set.
 
If USING NCHAR_CS is not specified, then this function returns the character having the binary equivalent to exp1 as a VARCHAR2 value in the database character set.
 
If USING NCHAR_CS is specified, then this function returns the character having the binary equivalent to n as a NVARCHAR2 value in the national character set.
Microsoft SQL Server
CHAR (exp1) 
A string function that converts an int ASCII code to a character.
 
Return type - char(1).
 
exp1 - is an integer from 0 through 255. NULL is returned if the integer expression is not in this range.
 
CHAR can be used to insert control characters into character strings. The table shows some commonly used control characters.
MySQL
CHAR(exp1 [,expN]...) 
Interprets the arguments as integers and returns a string consisting of the characters given by the ASCII code values of those integers. NULL values are skipped.
IBM DB2
CHR (exp1) 
Returns the character that has the ASCII code value specified by the argument.
 
The argument can be either INTEGER or SMALLINT. The value of the argument should be between 0 and 255; otherwise, the return value is null.
 
The result of the function is CHAR(1). The result can be null; if the argument is null, the result is the null value.
 
Sybase Adaptive Server Anywhere
CHAR (exp1) 
Returns the character with the ASCII value of a number.
 
exp1 - the number to be converted to an ASCII character. The number must be in the range 0 to 255, inclusive.
 
CHAR returns NULL for integer expressions with values greater than 255 or less than zero.
Sybase Adaptive Server Enterprise
CHAR (exp1) 
Returns the character equivalent of an integer.
 
exp1 - is any integer (tinyint, smallint, or int) column name, variable, or constant
expression between 0 and 255.
 
� CHAR, a string function, converts a single-byte integer value to a character value (char is usually used as the inverse of ascii.).
� CHAR returns a char data type. If the resulting value is the first byte of a multibyte character, the character may be undefined.
� If char_expr is NULL, returns NULL.
 
Reformatting output with char
� You can use concatenation and char values to add tabs or carriage returns to reformat output. char(10) converts to a return; char(9) converts to a tab.
 


Table of ContentsPreviousNext
Copyright 1999-2023 Ispirer Systems.
Ispirer and SQLWays are registered trademarks. All other product names may be trademarks of the respective companies.
All rights reserved.