Example of replacehar variants - Connect_CDC - connect_cdc_mimix_share - 5.8

Connect CDC System Reference Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (MIMIX Share)
Version
5.8
Language
English
Product name
Connect CDC
Title
Connect CDC System Reference Guide
Copyright
2024
First publish date
2003
ft:lastEdition
2024-02-12
ft:lastPublication
2024-02-12T15:11:59.486869

The following example shows two variants of replacechar.

begin returns char;
 
      /* i5 code points that cause errors in Teradata target. */
      /* We will replace them with the 'replace_char' code point */
      /* "COL_NAME" is the name of the character column needing cleansing */
 
      declare char input_value = nulltostring(COL_NAME, '<null>');
    declare int replace_char = 0x21; /* this is an exclamation point - set to desired ASCII character! */
 
      /* Code points to be cleansed: 0x80 through 0x85 inclusive and 0x1A */
         return replacechar( replacechar(input_value, 0x80, 0x85, replace_char),
                      0x1A, replace_char);
end;