Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Method to overlay 2 strings using regexp or other string manipulation

DW LassenFeb 22 2019 — edited Mar 4 2019

Hello,

I am struggling to find a solution to the following: I would like to find a way using PL/SQL regexp and/or string manipulation functions to "overlay" strings x and y which results in z like so:

x := 'X  XXX       XXX    '

y := ' X   XXX  X XX   XX '

z := 'XX XXXXX  X XXXX XX '

I realize that a function could be written to iterate through the strings character by character and perform the operation, but I need to do this with a large volume of long strings, so I was hoping to find a fast way to do this with regexp or some other "immediate" method to avoid iterating.

Thanks in advance for any input/ideas,

Dennis

Comments
Post Details
Added on Feb 22 2019
36 comments
1,310 views