Ispirer Website Ispirer Capabilities - Informix Migration Free Trial

Informix - String Functions

This article describes string functions in Infrormix.

Overview

Function Description
TRIM() Removes leading and/or trailing pad characters from a string

TRIM

Informix - TRIM
Syntax TRIM([BOTH | LEADING | TRAILING [pad_character] FROM] string)
Description Removes leading and/or trailing characters from a string

LEADING, TRAILING or BOTH pad_character removed from string.
Default pad_character is blank character (ASCII 32)
Trim option is BOTH
Return Type Returns NULL if pad_character or string is NULL.

Example:

CREATE TABLE trim_tb (cname VARCHAR(30));
INSERT INTO trim_tb VALUES ('San Francisco* ');

SELECT TRIM(TRAILING '*' FROM cname) FROM trim_tb;

Result:
-------

San Francisco

Informix TRIM - Equivalents in Other Databases

Database Equivalent
SQL Server RTRIM - Removes trailing blank characters
LTRIM - Removes leading blanks characters

© 1999-2024, Ispirer Systems, LLC. All Rights Reserved.