Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - SQL Reference » Using SQL » SQL functions » Alphabetical list of functions


TRIM function [String]

Removes leading and trailing blanks from a string.

TRIM( string-expression )
  • string-expression   The string to be trimmed.


This function supports NCHAR inputs and/or outputs.

See also
Standards and compatibility
  • SQL/2003   The TRIM function is a SQL/2003 core feature.

    SQL Anywhere does not support the additional parameters trim specification and trim character, as defined in SQL/2003. The SQL Anywhere implementation of TRIM corresponds to a TRIM specification of BOTH.

    For the other TRIM specifications defined by the SQL/2003 standard (LEADING and TRAILING), SQL Anywhere supplies the LTRIM and RTRIM functions respectively.


The following statement returns the value chocolate with no leading or trailing blanks.

SELECT TRIM( '   chocolate   ' );