GitHub user anoopsharma00 opened a pull request:
https://github.com/apache/trafodion/pull/1677
TRAFODION-3146 Support ANSI OVERLAY function
OVERLAY modifies a source string by replacing a given
substring of the string, which is specified by a given numeric starting
position and a given numeric length, with a replacement string).
When the length of the substring is zero, nothing is removed
from the source string and the string returned by the function is the
result of inserting the replacement string into the source string at the
starting position.
STUFF is syntactic variation of OVERLAY.
Example:
overlay ('source original string' placing 'modified ' from 8 for 9)
stuff ('source original string', 8, 9, 'modified ')
will return:
'source modified string'
overlay ('source original string' placing 'modified ' from 8 for 0)
will return:
'source modified original string'
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/anoopsharma00/trafodion ansharma_overlay_br
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafodion/pull/1677.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1677
----
commit ab38cbc907036e88a2f53092738e119b2acc19b9
Author: Anoop Sharma <anoop.sharma@...>
Date: 2018-08-02T21:31:08Z
TRAFODION-3146 Support ANSI OVERLAY function
OVERLAY modifies a source string by replacing a given
substring of the string, which is specified by a given numeric starting
position and a given numeric length, with a replacement string).
When the length of the substring is zero, nothing is removed
from the source string and the string returned by the function is the
result of inserting the replacement string into the source string at the
starting position.
STUFF is syntactic variation of OVERLAY.
Example:
overlay ('source original string' placing 'modified ' from 8 for 9)
stuff ('source original string', 8, 9, 'modified ')
will return:
'source modified string'
overlay ('source original string' placing 'modified ' from 8 for 0)
will return:
'source modified original string'
----
---