IBM Integration Bus, Version 10.0.0.9 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS


OVERLAY function

OVERLAY is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER) and replaces part of a string with a substring.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-OVERLAY--(--source_string-- PLACING --source_string2--------->

>-- FROM --start_position--+----------------------+--)---------><
                           '- FOR --string_length-'      

OVERLAY returns a new string of the same type as the source and is identical to source_string, except that a given substring in the string, starting from the specified numeric position and of the given length, has been replaced by source_string2. When the length of the substring is zero, nothing is replaced.

For example:
OVERLAY ('ABCDEFGHIJ' PLACING '1234' FROM 4 FOR 3)
returns the string 'ABC1234GHIJ'

If any parameter is NULL, the result is NULL. If string_length is not specified, it is assumed to be equal to LENGTH(source_string2).

The result of the OVERLAY function is equivalent to:
SUBSTRING(source_string FROM 1 FOR start_position -1 )
  || source_string2 ||
  SUBSTRING(source_string FROM start_position + string_length)
where || is the concatenation operator.

ak05230_.htm | Last updated 2017-07-17 12:45:32