I seem to have a problem with using two single quote characters ('') to escape a single quote character (') in a string literal when calling selectQuery SOAP API function.

The escaped string used for query argument of selectQuery call is:

SELECT id FROM test1 WHERE externalReference1 = 'TEST''DATA' 

This produces a MySQL error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''DATA)' at line 1

Can you help, please? Thanks.