如何解决以下 Oracle NoSQL 错误(查询不包含变量)?
How to solve the following Oracle NoSQL error (The query doesn't contain the variable)?
尝试使用 API 调用
进行查询时出现以下错误
{
"code": "InvalidParameter",
"message": "The query doesn't contain the variable: id"
}
拜托,ci-在负载和执行的调用下方
oci-curl nosql.eu-frankfurt-1.oci.oraclecloud.com post ./request.json "/20190828/query" | jq
[opc@instance-dev ~]$ cat request.json
{
"compartmentId": "ocid1.xxxxxx"
, "statement": "DECLARE $id LONG; SELECT * FROM test_table where id > $id"
, "variables" : {"id":"10"}
}
变量必须与 DECLARE 语句中的变量相同,包括 $ 和相同的类型。
在你的例子中,变量的好名字是 $id 而不是 id
"variables" : {"$id":10}
尝试使用 API 调用
进行查询时出现以下错误{
"code": "InvalidParameter",
"message": "The query doesn't contain the variable: id"
}
拜托,ci-在负载和执行的调用下方
oci-curl nosql.eu-frankfurt-1.oci.oraclecloud.com post ./request.json "/20190828/query" | jq
[opc@instance-dev ~]$ cat request.json
{
"compartmentId": "ocid1.xxxxxx"
, "statement": "DECLARE $id LONG; SELECT * FROM test_table where id > $id"
, "variables" : {"id":"10"}
}
变量必须与 DECLARE 语句中的变量相同,包括 $ 和相同的类型。
在你的例子中,变量的好名字是 $id 而不是 id
"variables" : {"$id":10}