CHR: Returning the ASCII Character Given a Numeric Code

How to:

Given a number code as an argument, CHR returns the ASCII character.

Syntax: How to Return the ASCII Character Given a Numeric Code

CHR(number)

where:

number

Numeric

Is the numeric code to be translated to an ASCII character.

Example: Returning the ASCII Character Given a Numeric Code

The following SELECT statement places a colon character between last name and first name.

SQL
SELECT
LAST_NAME AS ' ', CHR(58) AS ' ', FIRST_NAME AS ' '
FROM EMPLOYEE
;
TABLE
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
GRID=OFF,$
ENDSTYLE
END

The output is shown in the following image.