Does Matlab’s database toolbox have a function to sanitize inputs? I can’t find any mention of one in the documentation.
I have a bunch of strings that I’d like to write to a MySQL database. Some of the strings contain apostrophes, and these are causing errors. I’m looking for a simple way to preprocess the strings to make them database-friendly.
Also, it’s not necessary in my application to be able to reconstruct the original strings exactly. The preprocessing step never needs to be “undone”.
In the end I used matlab’s genvarname function to preprocess my strings. This function doesn’t do database sanitization, per se, and it’s not invertible, but it does remove apostrophes. It met my needs.