Skip to main content
Scalar function
Returns NULL when any supplied argument is NULL.

Syntax

Scalar

Arguments

Returns

  • Type: STRING
  • Possible values: A padded/truncated string; negative lengths act as zero and return an empty string.
  • NULL behavior: Returns NULL when any supplied argument is NULL.

Properties

Usage notes

  • An empty fill string supplies no padding; the original string is retained when it is shorter than the requested length.
  • The fill pattern repeats and is truncated to the required character count.

Examples

Typical behavior

Pad with spaces by default

The quotes below make the leading or trailing spaces visible.

Limitations

  • Target lengths above 2147483647 raise an execution error.
Last modified on October 15, 2026