PowerCenter
- PowerCenter 10.5.7
- All Products
REPLACESTR (CaseFlag,InputString,OldString1, [OldString2, ... OldStringN,]NewString)
Argument
| Required/
Optional
| Description
|
---|---|---|
CaseFlag
| Required
| Must be an integer. Determines whether the arguments in this function are case sensitive. You can enter any valid transformation expression.
When
CaseFlag is a number other than 0, the function is case sensitive.
When
CaseFlag is a null value or 0, the function is not case sensitive.
|
InputString
| Required
| Must be a character string. Passes the strings you want to search. You can enter any valid transformation expression. If you pass a numeric value, the function converts it to a character string.
If
InputString is NULL, REPLACESTR returns NULL.
|
OldString
| Required
| Must be a character string. The string you want to replace. You must enter at least one
OldString argument. You can enter one or more characters per
OldString argument. You can enter any valid transformation expression. You can also enter a text literal enclosed within single quotation marks, for example, 'abc'.
If you pass a numeric value, the function converts it to a character string.
When REPLACESTR contains multiple
OldString arguments, and one or more
OldString arguments is NULL or empty, REPLACESTR ignores the
OldString argument. When all
OldString arguments are NULL or empty, REPLACESTR returns
InputString .
The function replaces the characters in the
OldString arguments in the order they appear in the function. For example, if you enter multiple
OldString arguments, the first
OldString argument has precedence over the second
OldString argument, and the second
OldString argument has precedence over the third
OldString argument. When REPLACESTR replaces a string, it places the cursor after the replaced characters in
InputString before searching for the next match.
|
NewString
| Required
| Must be a character string. You can enter one character, multiple characters, an empty string, or NULL. You can enter any valid transformation expression.
If
NewString is NULL or empty, REPLACESTR removes all occurrences of
OldString in
InputString .
|
REPLACESTR( 1, WEBLOG, '"', 'GET ', ' HTTP/1.1', NULL )
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
REPLACESTR ( 1, TITLE, 'rs.', 'iss', 's.' )
|
|
---|---|
|
|
|
|
|
|
|
|
REPLACESTR ( 0, TITLE, 'rs.', 'iss', 's.' )
|
|
---|---|
|
|
|
|
REPLACESTR ( 1, INPUT, 'ab', 'bc', '*' )
|
|
---|---|
|
|
|
|
|
|
|
|
REPLACESTR ( 1, INPUT, 'ab', 'bc', 'b' )
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
CONCAT( 'Joan', CONCAT( CHR(39), 's car' ))
Joan's car
REPLACESTR ( 1, INPUT, CONCAT('it', CONCAT(CHR(39), 's' )), 'its' )
|
|
---|---|
|
|
|
|
|
|
|
|