0

尝试使用 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"}
}
4

1 回答 1

0

变量必须与 DECLARE 语句中的变量相同,包括 $ 和相同的类型。

在您的情况下,变量的好名称是 $id 而不是 id

"variables" : {"$id":10}

于 2021-06-07T09:12:15.180 回答