The TRIM function
When you dynamically execute a SELECT statement, the DESCRIBE statement can return information about the columns in the select list of the Projection clause at run time. DESCRIBE returns the data type of a select-list column in the appropriate field of the dynamic-management structure that you use.
When you use the DESCRIBE statement on a prepared SELECT statement with the TRIM function in its select list, the data type of the trimmed column that DESCRIBE returns depends on the database server that you use and the data type of the column to be trimmed (the source character-value expression). For more information about the source character-value expression, see the description of the TRIM function in the Informix® Guide to SQL: Syntax.
Sequence number | Operand type | Result type | Result length |
---|---|---|---|
1 | (N)CHAR(1-255) | (N)VARCHAR | Up to 255 |
2 | (N)CHAR(>255) | LVARCHAR | Up to 32739 |
3 | (N)VARCHAR | (N)VARCHAR | Up to 255 |
4 | LVARCHAR | LVARCHAR | Up to 32739 |
SELECT TRIM(manu_code), TRIM(cat_advert) FROM catalog;