Removes all the trailing characters in char_expression that are present in char_set and returns the resultant string. The last character in the result is guaranteed not to be in char_set. If you do not specify a char_set, trailing blanks are removed.

Syntax

RTRIM ( char_expression[ , char_set] )

Notes

  • The first argument to the function must be of type CHARACTER.
  • The second argument to the function must be of type CHARACTER.
  • The result is of type CHARACTER.
  • If the argument expression evaluates to NULL, the result is NULL.
  • The char_expression, the character set specified by char_set, and the result can contain multi‑byte characters. Character comparisons are case sensitive and are determined by the collation table in the database.

Example

This example illustrates the RTRIM function:

SELECT RPAD ( RTRIM (addr, ' '), 30, '.') 
     FROM customer ;

Compatibility

ODBC compatible