SPACE Function

Description

The SPACE function returns as many empy strings as the number specified. The return value is a VARCHAR type.

Syntax

SPACE(N)

Example

SELECT SPACE(8);

   space(8)

======================

  '        '

 

SELECT LENGTH(space(1048576));

   char_length( space(1048576))

===============================

                        1048576

 

SELECT LENGTH(space(1048577));

   char_length( space(1048577))

===============================

                           NULL

 

-- string_max_size_bytes=33554432

SELECT LENGTH(space('33554432'));

   char_length( space('33554432'))

==================================

                          33554432

 

SELECT SPACE('aaa');

 

ERROR: Cannot coerce value of domain "character" to domain "bigint".