Welcome to the new DOCS.vastdata.com. We've added new menus and a version selector, plus new persona and resource pages to help customers get started. Looking for a previous article? Use the docs search.

Trimming and padding

Prev Next

Applies to VAST Cluster 5.5.

Removing characters from the ends of a string, and padding it to a width.

Each function has its own page: syntax, what it does, NULLs and edge cases, examples with their output, how it runs in VAST, how to make it faster, limitations and errors, and similar functions. Names that the VAST Query Engine doesn't have are in all functions A-Z.

Trimming and padding

Function What it does
ltrim Remove spaces, or any characters you list, from the start of a VARCHAR.
rtrim Remove spaces, or any characters you list, from the end of a VARCHAR.
trim Remove spaces, or any characters you list, from both ends of a VARCHAR; trim(BOTH | LEADING | TRAILING chars FROM s) is the standard SQL form.
lpad Pad a VARCHAR on the left with a fill string to a given number of characters, or cut it to that length.
rpad Pad a VARCHAR on the right with a fill string to a given number of characters, or cut it to that length.

See also