Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions
  8. Creating Custom Functions
  9. Custom Function API Reference

Transformation Language Reference

Transformation Language Reference

CHR

CHR

When the
PowerCenter Integration Service
uses ASCII mode, CHR returns the ASCII character corresponding to the numeric value you pass to this function. ASCII values fall in the range 0 to 255. You can pass any integer to CHR, but only ASCII codes 32 to 126 are printable characters.
When the
PowerCenter Integration Service
uses Unicode mode, CHR returns the Unicode character corresponding to the numeric value you pass to this function. Unicode values fall in the range 0 to 65,535.

Syntax

CHR(
numeric_value
)
The following table describes the argument for this command:
Argument
Required/
Optional
Description
numeric_value
Required
Numeric datatype. The value you want to return as an ASCII or Unicode character. You can enter any valid transformation expression.

Return Value

ASCII or Unicode character. A string containing one character.
NULL if a value passed to the function is NULL.

Example

The following expression returns the ASCII or Unicode character for each numeric value in the ITEM_ID port:
CHR( ITEM_ID )
ITEM_ID
RETURN VALUE
65
A
122
z
NULL
NULL
88
X
100
d
71
G
Use the CHR function to concatenate a single quote onto a string. The single quote is the only character that you cannot use inside a string literal. Consider the following example:
'Joan' || CHR(39) || 's car'
The return value is:
Joan's car

0 COMMENTS

We’d like to hear from you!