Table of Contents

Search

  1. About the Data Vault SQL Reference
  2. Introduction to SQL Reference for Informatica Data Vault
  3. Date and Time Arithmetic
  4. WHERE Clauses
  5. UNION Operator
  6. Parameterized Query
  7. Functions

Data Vault SQL Reference

Data Vault SQL Reference

REPLACE

REPLACE

Replaces characters in a string with a specified substring. REPLACE searches the input string for all instances of the substring you specify and replaces them with the replacement string you specify.

Syntax

REPLACE ( InputString, Substring[, ReplacementString] )
Argument
DataType
Description
InputString
char
String in which to search for a substring to be replaced by another string.
Substring
char
Substring to search for that you want to replace with ReplacementString.
ReplacementString
char
Optional. String to replace Substring. If you do not pass this parameter, REPLACE deletes all occurrences of Substring.

Return Value

String with the specified substring replaced or deleted.

Example

If a column named col1 contains the string "The fox sees another fox in the meadow.", the following expression replaces all instances of the substring "fox" with the string "rabbit":
REPLACE ( col1, 'fox', 'rabbit' )
The function call returns the following string:
The rabbit sees another rabbit in the meadow.

0 COMMENTS

We’d like to hear from you!