REPEAT Function

Repeats a character expression.

Category: Character
Returned data type: VARCHAR, NVARCHAR

Syntax

REPEAT(expression, n)

Arguments

expression

specifies any valid expression that evaluates to a character string.

Data type CHAR, NCHAR
See <sql-expression>
FedSQL Expressions

n

specifies the number of times to repeat expression.

Restriction n must be greater than or equal to 0.
Data type INTEGER

Details

The REPEAT function returns a character value consisting of the first argument repeated n times. Thus, the first argument appears n+1 times in the result.

Example

The following statement illustrates the REPEAT function:
Statements
Results
select repeat('ONE',2);
ONEONEONE
Last updated: February 23, 2017