The SPACE function creates a character string of a specified number
of blank spaces. The maximum length of the returned string value can be 32,739 blank
characters.
The function has this syntax:
SPACE Function
Element
Description
Restrictions
Syntax
expression
Expression that evaluates to a non-negative whole number < 256
Must be an expression, constant, column, or host variable of a built-in
integer type, or one that can be converted to an integer
The argument to the SPACE function must be of a built-in data type.
The SPACE function returns an LVARCHAR string of the specified number of
blank (ASCII 32 ) characters.
If the argument evaluates to a NULL value, or to a number less than 1, this function returns a
NULL value, rather than an empty string.
In the following example, the SPACE function returns a single-character
blank string:
SELECTSPACE(1) FROM tabula_rasa;
The following table shows the output from this SELECT statement, which is a single blank
character:
(constant)
Have feedback?
Google Analytics is used to store comments and ratings. To provide a comment or rating for a topic, click Accept All Cookies or Allow All in Cookie Preferences in the footer of this page.