Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

How to replace string markers with varchar2 array content

juliojgsFeb 7 2024

This is 19c, and I have installed apex packages.

Let's say I want to build a callback to a service, so I want to give a descriptive error text which can be in different languages and have some variable text inside.

I can have the table in the database like this sample:

code  language  text
====  ========  =================
001   en        Failure due to signal {marker} . You need to contact {marker}
001   sp        Error debido a seƱal {marker} . Debe contactar con {marker}

Then I call a function to retrieve the text, passing the code, the language and a varchar2 collection with the marker substitution values.

How can I replace first {marker} with first value and second {marker} with second value?

Or maybe you can suggest another approach for all of it?

Thanks.

This post has been answered by mathguy on Feb 9 2024
Jump to Answer
Comments
Post Details
Added on Feb 7 2024
12 comments
129 views