ESCAPESINGLEQUOTE function

The ESCAPESINGLEQUOTE function helps you to ignore the single quotes that are typically present in data that you want to insert in SQL or any relational database for example. By escaping single quotes you can process the JSON values as valid data for any further processing.

Syntax

ESCAPESINGLEQUOTE(string / json field)

Where,

  • <string/json>: is the column or field value that contains the single quote symbol

Example

ESCAPESINGLEQUOTE ([{“productname2”:“Welch’s Fruit Snacks”,“price”:20}] )

Will return

[{“productname2”:“Welch\’s Fruit Snacks”,“price”:20} which would be a valid input for the insert statement for SQL databases.

To know more about using the function refer to this article here.