Reputation: 424
Does anyone know how to escape a single quote (') when executing a query with the Vtiger webservice?
I've tried the following:
The error that I get is:
{u'error': {u'code': u'QUERY_SYNTAX_ERROR',
u'message': u"Syntax Error on line 1: token 'Connor' Unexpected COLUMNNAME(Connor), expected one of: SEMICOLON",
u'xdebug_message': u"\nWebServiceException: Syntax Error on line 1: token 'Connor' Unexpected COLUMNNAME(Connor), expected one of: SEMICOLON in /var/www/sites/vtigercrm6_test/include/Webservices/VTQL_Parser.php on line 1499\n\nCall Stack:\n 0.0001 221800 1. {main}() /var/www/sites/vtigercrm6_test/webservice.php:0\n 0.0163 3089752 2. OperationManager->runOperation() /var/www/sites/vtigercrm6_test/webservice.php:134\n"},
u'success': False}
Thanks!
Upvotes: 0
Views: 472
Reputation: 424
I was able to figure it out - double single quotes!!
select * from Contacts where lastname = 'O''Connor';
Upvotes: 0