SPACE Function [String]

Returns a specified number of spaces.

Syntax

SPACEinteger-expression )

Parameters

Parameter

Description

integer-expression

The number of spaces to return.

Returns

LONG VARCHAR

Note: The result data type is a LONG VARCHAR. If you use SPACE in a SELECT INTO statement, you must have an Unstructured Data Analytics Option license or use CAST and set SPACE to the correct data type and size.

Example

The following statement returns a string containing 10 spaces:

SELECT SPACE( 10 ) FROM iq_dummy

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Compatible with Adaptive Server Enterprise.