SQL/MX 3.2.1 Reference Manual (H06.26+, J06.15+)
SQL/MX Functions and Expressions
HP NonStop SQL/MX Release 3.2.1 Reference Manual—691117-004
8-152
RTRIM Function
RTRIM Function
The RTRIM function removes the specified trim characters from the right side of the
character string. If the trim characters are not specified, by default, the function
removes spaces.
srcstr
is a SQL character value expression from which spaces or trim_chrs are
removed from the right side. See Character Value Expressions on page 6-41.
trim_chrs
is the character or characters to be removed from the srcstr . The default is the
space character.
Considerations for RTRIM
Result of RTRIM
The result is always of type NON ANSI VARCHAR, with maximum length equal to the
fixed length or maximum variable length of srcstr.
Examples of RTRIM
•
Return ' Robert':
RTRIM (' Robert ')
See TRIM Function on page 8-192 and LTRIM Function on page 8-102.
•
In this example, characters '1' and '0' are removed from the right side of the colA
value:
create table tab1(colA varchar(20), colB int);
insert into tab1 values('ten0101010101', 10);
insert into tab1 values('nine11001101', 9);
select rtrim(colA,'10'), colB from tab1;
(EXPR) COLB
-------------------- -----------
ten 10
nine 9
--- 2 row(s) selected
RTRIM(srcstr[, trim_chrs])










