Reputation: 387
What I wanted is to place every string inside single qoutes even if it is delimited by a dot something like this:
Input: Hi.Hello.World
Output: 'Hi'.'Hello'.'World'
Note: Inputs can be 2 or more words delimited by a dot
Upvotes: 0
Views: 25
Reputation: 522191
You could try this:
SELECT '''' || REPLACE(string, '.', '''.''') || ''''
FROM yourTable
The idea here is we replace every dot .
with dot in single quotes '.'
. This covers all internal dots/quotes. Then, to handle the outside single quotes, we can concatenate them on both sides.
Upvotes: 3