Python 2.7 分析错误:符号处的WHERE标识符无效(
我正在尝试使用可选参数获得结果Python 2.7 分析错误:符号处的WHERE标识符无效(,python-2.7,google-cloud-platform,google-cloud-datastore,gql,Python 2.7,Google Cloud Platform,Google Cloud Datastore,Gql,我正在尝试使用可选参数获得结果 result = Tester.gql("WHERE (first_name IS NULL OR first_name = :first_name)" "AND (last_name IS NULL OR last_name = :last_name)" "AND (birth_date IS NULL OR birth_date =
result = Tester.gql("WHERE (first_name IS NULL OR first_name = :first_name)"
"AND (last_name IS NULL OR last_name = :last_name)"
"AND (birth_date IS NULL OR birth_date = :birth_date)"
"AND (test_voucher IS NULL OR test_voucher = :test_voucher)", first_name=first_name,
last_name=last_name, birth_date=birth_date, test_voucher=test_voucher)
但是,当我使用这个GQL脚本时,我在解析方面遇到了一个错误
{
"error": {
"message": "Parse Error: Invalid WHERE Identifier at symbol ("
}
}
我正在试图找出我的GQL脚本中的错误。请提前感谢我认为这不是有效的GQL: 没有提到使用和对于复合条件(我相信您看到的错误是关于这一点),唯一有效的条件构造来自: GQL中没有OR运算符,因此不需要分组,另请参见关于括号的抱怨
[ WHERE <compound-condition> ]
<compound-condition> := <condition>+AND
<condition> :=
<property-name> IS NULL
| <property-name> <forward-comparator> <value>
| <value> <backward-comparator> <property-name>