SQL/MX 3.2 Reference Manual (H06.25+, J06.14+)
SQL/MX Functions and Expressions
HP NonStop SQL/MX Release 3.2 Reference Manual—691117-001
9-102
LTRIM Function
LTRIM Function
The LTRIM function removes the specified trim characters from the left 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 left 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 LTRIM
Result of LTRIM
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 LTRIM
Return 'Robert ':
LTRIM (' Robert ')
See TRIM Function on page 9-192 and RTRIM Function on page 9-152.
In this example, characters '1' and '0' are removed from the left side of the colA
value:
create table tab1(colA varchar(20), colB int);
insert into tab1 values('0101010101ten', 10);
insert into tab1 values('11001101nine', 9);
select ltrim(colA, '10'), colB from tab1;
(EXPR) COLB
-------------------- -----------
ten 10
nine 9
LTRIM(srcstr[, trim_chrs])










