Mixed numeric and text values
Input
1
2
abcOutput
id IN (1, 2, 'abc')Numbers stay unquoted; the text value is quoted.
Optional.
Turning a column of IDs from a spreadsheet or a log into a SQL IN clause is tedious by hand and easy to get wrong. Paste the values one per line or comma-separated, and you get a correctly quoted clause.
Quoting is decided per value: numbers are left bare and anything else is quoted with its apostrophes doubled, which is what makes the result safe to paste into a query.
Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.
Input
1
2
abcOutput
id IN (1, 2, 'abc')Numbers stay unquoted; the text value is quoted.
The details that decide whether a conversion is correct, and where information can be lost without any error being raised.