Often a text needs to be shortened to fit available space. To shorten a text, the substr
SQL function can be used. However, characters at both the begin and end often carry more context than characters in the middle.
The new SQL function shorten
assists in resizing long texts to fit a pre-defined length by removing characters from the middle and replacing them by a shorter text.
For example:
select shorten('abcdefghijklmnopqrstuvwxyz', 10, '#')
will return:
abcd#vwxyz
Availability
The SQL function “shorten” will be available starting release 24.0.220.