如何在Vtiger Webservice中转义单引号

时间:2015-07-08 23:36:29

标签: web-services vtiger

有没有人知道在使用Vtiger webservice执行查询时如何转义单引号(')?

我尝试了以下内容:

  • 从Contacts中选择*,其中lastname =“O'Connor”;
  • 从Contacts中选择*,其中lastname ='O \'Connor';
  • 从Contacts中选择*,其中lastname ='O \\'Connor';
  • 从Contacts中选择*,其中lastname ='O%'Connor';
  • 从Contacts中选择*,其中lastname ='O %%'Connor';

我得到的错误是:

{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}

Vtiger Webservice Reference

谢谢!

1 个答案:

答案 0 :(得分:0)

我能够弄明白 - 双单引号!!

select * from Contacts where lastname = 'O''Connor';