SQL standard string literal escaper
Inspect the standard single-quoted SQL literal representation of a text value.
Worked input and output
Input
O'Reilly
Output
'O''Reilly'
The apostrophe inside O’Reilly is doubled, and the entire value is enclosed in single quotes. This does not quote table/column names or make string-built SQL safe.