Answer the question
In order to leave comments, you need to log in
How to get rid of backslash in VARCHAR with INSERT?
With
, an error occurs because the backslash escapes the single quote. Question. How to get rid of this backslash and make a recording as if this backslash did not exist at all?
The REPLACE() function does not help... I tried REPLACE('ivan\', '\', '') and REPLACE('ivan\', '\\', '').
Or how, for example, to replace all backslashes in the text (to avoid escaping) with forward slashes? ps. The application writes to the database not directly, but through my stored function. When calling the function with the 'ivan\' parameter, an error occurs (syntax). Without the backslash at the end, everything is written perfectly. I don't have access to the app.
The problem needs to be solved EXCLUSIVELY by means of MySQL. ppsinsert into table_name(name) value('ivan\');
Alternatively, you can read the string in binary form and if you see a backslash byte, then change it to a slash byte or any other string. But that's just some bullshit. Surely there is a way to solve it much easier and more natural.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question