IBM PureData System for Analytics, Version 7.1

The replace() function

The replace() function replaces each instance of pattern in input with the value in the string replacement.

Description

The replace() function has the following syntax:
varchar = replace(varchar input, varchar pattern, varchar 
replacement);
nvarchar = replace(nvarchar input, nvarchar pattern, nvarchar 
replacement);

The input value specifies the varchar or nvarchar in which the characters are replaced.

The pattern value specifies the characters to replace.

The replacement value specifies the characters to substitute for each instance of pattern.

Returns

For example:
select replace('persisaent','a','t');
  REPLACE
------------
 persistent
(1 row)


Feedback | Copyright IBM Corporation 2014 | Last updated: 2014-02-28