Table of Contents

Search

  1. Preface
  2. XML Concepts
  3. Using XML with PowerCenter
  4. Working with XML Sources
  5. Using the XML Editor
  6. Working with XML Targets
  7. XML Source Qualifier Transformation
  8. Midstream XML Transformations
  9. Appendix A: XML Datatype Reference
  10. Appendix B: XPath Query Functions Reference

XML Guide

XML Guide

translate

translate

Converts the characters in a string to other characters. The function uses two other strings as translation pairs.

Syntax

translate (
string1, string2, string3
)
The following table describes the arguments for this function:
Argument
Description
string1
String datatype. Passes the string to translate.
string2
String datatype. Passes the string that defines which characters to translate. Translate replaces each character in
string1
with a number indicating its position in
string2
.
string3
String datatype. Passes the string that defines what the characters from encrypted
string1
should translate to. Translate replaces each character in encrypted
string1
with a character in
string3
at the position number from
string2
.

Return Value

String.

Example

The following expression translates a string using two other strings:
translate ( EXPRESSION, STRING2, STRING3 )
The following table contains example arguments and return values:
EXPRESSION
STRING2
STRING3
RETURN VALUE
A Space Odissei
i
y
A Space Odyssey
rats
tras
TCAS
CATS
bar
abc
ABC
BAr
Translate does not change a character in EXPRESSION if the character does not occur in string2. If a character occurs in EXPRESSION and string2, but does not occur in string3, the character does not occur in the returned string.

0 COMMENTS

We’d like to hear from you!