COPY
COPY returns a string consisting of y concatenated copies of the string x.
- x
- Expression.
x must have a computational type and should have a string type. If not, it is converted to character.
- y
- An integer expression with a nonnegative value. It specifies the
number of repetitions. It must have a computational type and is converted
to FIXED BINARY(31,0).
If y is zero, the result is a null string.
Example
Considering the following code:
copy('Walla ',1) /* returns 'Walla ' */
repeat('Walla ',1) /* returns 'Walla Walla ' */
In
this example, repeat(x,n)
is equivalent to copy(x,n+1)
.