REPLACE()

Scalar. Returns a given string with every instance of a specified substring replaced with another specified string.

Syntax

REPLACE( string, find, replacement )
Parameters

string

A string.

find

The string to locate.

replacement

The string to substitute for every occurrence of find.

Data Types

Return

string

find

replacement

String

String

String

String

Example

The following example uses the REPLACE function to substitute the result of multiplying the values of two columns, converted to a string, for a square bracketed x in the filledOrder column:

INSERT INTO OutStream
SELECT REPLACE(Transaction.filledOrder, '[x]', 
       TO_STRING(InStock.price*InStock.quantity) )
FROM Orders, InStock;