SQL-J Language Reference
Page 79 of 121

RTRIM

RTRIM trims one or more instances of a trailing character string, or any characters within the trailing character string, from a character string expression.

RTRIM(CharacterExpression [ , trimCharacters ] )

A CharacterExpression is a CHAR, VARCHAR, or LONG VARCHAR data type, any built-in type that is implicitly converted to a string, or any Java data type that directly maps to a built-in type that is implicitly converted to a string.

RTRIM returns NULL if either CharacterExpression or trimCharacters evaluates to null.

If trimCharacters is not specified, it defaults to ' ' (blank). It can be multiple characters.

RTRIM Examples

-- returns ' asdf'
VALUES
RTRIM(' asdf ')

-- returns 'asdf'
VALUES
RTRIM('asdf', 'sa')

-- returns 'as'
VALUES
RTRIM('asdf', 'fd')

--returns 'as'
VALUES
RTRIM('asdfdfdf', 'df')

--returns 'asdfg'
VALUES
RTRIM('asdfgfffffff', 'df')