Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

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 expression can be any of the fixed length or variable length character types.
  • 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.

TOCIndex