REPLICATE function [String]

Function

Concatenates a string a specified number of times.

Syntax

REPLICATE ( string-expression, integer-expression )

Parameters

string-expression The string to be repeated.

integer-expression The number of times the string is to be repeated.

Example

The following statement returns the value “repeatrepeatrepeat:”

SELECT REPLICATE( 'repeat', 3 ) FROM iq_dummy

Usage

REPLICATE is the same as the REPEAT function.

NoteThe result datatype of a REPLICATE function is a LONG VARCHAR. If you use REPLICATE in a SELECT INTO statement, you must have a Large Objects Management option license or use CAST and set REPLICATE to the correct datatype and size.

See “REPLACE function [String]” for more information.

Standards and compatibility

See also

“REPEAT function [String]”