Total Pageviews

2019/01/07

[Database] [Sybase] How to implement trim() in Sybase?

Problem
If I would like to remove unnecessary space from a column value, how to do it in Sybase?

Sybase does not have trim function which provide by Oracle.
Error: Function 'trim' not found. If this is a SQLJ function or SQL function, use sp_help to check whether the object exists (sp_help may produce a large amount of output).

SQLState:  S1000
ErrorCode: 14216


How-To
You can use ltrim and rtrim to fulfill this requirement:
select ltrim(rtrim('   123aa       '))


No comments: