WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

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.
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:47:11


Reference topicReference topic | Version 8.0.0.7 | ak05230_