Example of replacehar variants - Connect_CDC - connect_cdc_mimix_share - Latest

Connect CDC System Reference Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (MIMIX Share)
Version
Latest
Language
English
Product name
Connect CDC
Title
Connect CDC System Reference Guide
Copyright
2024
First publish date
2003
Last edition
2024-08-20
Last publish date
2024-08-20T21:40:14.000381
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;