Oracle9i SQL Reference
Release 1 (9.0.1)

Part Number A90125-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Functions, 18 of 166


CHR

Syntax

chr::=


Text description of functions39a.gif follows
Text description of chr

Purpose

CHR returns the character having the binary equivalent to n in either the database character set or the national character set.

If USING NCHAR_CS is not specified, this function returns the character having the binary equivalent to n as a VARCHAR2 value in the database character set.

If USING NCHAR_CS is specified, this function returns the character having the binary equivalent to n as a NVARCHAR2 value in the national character set.


Note:

Use of the CHR function (either with or without the optional USING NCHAR_CS clause) results in code that is not portable between ASCII- and EBCDIC-based machine architectures. 


See Also:

NCHR 

Examples

The following example is run on an ASCII-based machine with the database character set defined as WE8ISO8859P1:

SELECT CHR(67)||CHR(65)||CHR(84) "Dog" FROM DUAL;

Dog
---
CAT

To produce the same results on an EBCDIC-based machine with the WE8EBCDIC1047 character set, the first example above would have to be modified as follows:

SELECT CHR(195)||CHR(193)||CHR(227) "Dog" 
   FROM DUAL; 

Dog 
--- 
CAT 

The following example uses the UTF8 character set:

SELECT CHR (50052 USING NCHAR_CS) FROM DUAL; 

CH 
-- 
Ä 

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback