I have a function that receives JSON's, it happens that the user can put it like this:
Normal :
'[{"nome":"João Carlos"}, {"nome":"Maria Silva"}]'
Problem :
'[{"nome":"João - "Carlos" - "}, {"nome":"Maria Silva"}]'
Note that it is possible for the user to put double or single quotes in the name field, how could I escape these quotes?
I use the JSON_ARRAY_ELEMENTS
function to separate each JSON into rows.
SELECT
*
FROM
json_array_elements('[{"nome":"João - "Carlos" - "}, {"nome":"Maria Silva"}]')