APPX Software Library

Chapter 4: SQL Language Elements

4.9.2.67 REPEAT function (ODBC compatible)

Syntax

REPEAT ( string_exp,count )

Description

The scalar function REPEAT returns a character string composed of string_exp repeated count times.

Example

SELECT REPEAT(fld1,3)
FROM   test100
WHERE  fld1 = 'Afghanistan'

Results

REPEAT(FLD1,3)

AfghanistanAfghanistanAfghanistan

1 record selected

Notes

  • The string exp. can be of the type fixed length or variable length CHARACTER.
  • The count can be of the type INTEGER, SMALLINT, BIGINT, or TINYINT.
  • If any of the arguments of the expression evaluates to a null, the result would be null.
  • If the count is negative or zero ,the result evaluates to a null.