Skip to content
Advertisement

Removing backslashes when using Oracle’s JSON_ARRAY function?

How do you get rid of the back slashes, but still keep the double quotes when using json_array?

TABLE A:

Wrong code:

Wrong output:

Desired output:

And yes, I know you can just concatenate like so "select '['|| etc. without using the json_array, but I need to have that in the code. Is there a way to use regexp_replace somehow, to get rid of that ?? Thanks!

Advertisement

Answer

No need for concatenation:

Online example

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement