I am writing an INSERT query that inserts a large amount of values into a table. Alas, I cannot use parameterized queries in this special case.
So I would like to have a function to remove all bad characters that lead to an INSERT failure. E.g. in the following query
INSERT INTO myTable (a,b,c) VALUES ("a","b","c")
If the value of a
contains a quote "
, this will probably ruin the entire INSERT. So is there a function to remove all these risky characters? Otherwise, what are the characters that are dangerous?