Skip Headers

Oracle® OLAP DML Reference
10g Release 1 (10.1)

Part Number B10339-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

CHANGECHARS

The CHANGECHARS function changes one or more occurrences of a specified string in a text expression to another string.


See also:

The following related functions:
  • CHANGEBYTES which you can use instead of CHANGECHARS when you are using a multibyte character set

  • REPLCHARS which you can use to replace characters in a text value beginning at a certain character


Return Value

TEXT or NTEXT

This function accepts TEXT values and NTEXT values as arguments. The data type of the return value depends on the data type of the values specified for the arguments:

Syntax

CHANGECHARS(text-expression oldtext newtext [number] [UPCASE])

Arguments

text-expression

The expression in which characters are to be changed. When text-expression is a multiline text value, CHANGECHARS preserves the line breaks in the returned value.

oldtext

A text expression that contains one or more characters that will be changed.

newtext

A text expression that contains one or more characters that will replace oldtext.

number

An INTEGER that represents the number of times oldtext should be replaced with newtext when oldtext appears more than once in text-expression. The default is to change all occurrences of oldtext.

UPCASE

Specifies that CHANGECHARS should uppercase text-expression and oldtext before trying to find a match. CHANGECHARS does not uppercase the return value.

Examples

Example 8-43 Changing the Values of Text Characters

This example shows how to change one instance of a portion of a text value.

The statement

SHOW CHANGECHARS('Hello there, Joe\nHello there, Jane', 
   'there', - 'to you', 1)

produces the following output.

Hello to you, Joe
Hello there, Jane