I am using 5.0.0-2194 Enterprise Edition (build-2194).
when I run the following N1QL
SELECT CURL("GET","http://192.168.199.128:4984/sg/_changes",
{"header":"Cookie: SyncGatewaySession=b71792a2f40c36e26bf7a0bfd1e745f520521711","data":"feed=normal&feed=normal&include_docs=false&active_only=false"}).last_seq
it works fine.
but when I want to Parametric address and cookies like,
curl -v http://127.0.0.1:8093/query/service --data-urlencode 'statement=PREPARE queryLastSeq FROM SELECT CURL("GET","$sg_address", {"header":"Cookie:SyncGatewaySession=$Cookie","data":"feed=normal&feed=normal&include_docs=false&active_only=false"}).last_seq;'
and when I run by
curl -v http://j127.0.0.1:8093/query/service -d 'prepared="queryLastSeq"&$sg_address="http://192.168.199.128:4984/sg/_changes"&$Cookie="b71792a2f40c36e26bf7a0bfd1e745f520521711"'
I got the following error:
"errors": [
{
"code": 5010,
"msg": "Error evaluating projection. - cause: curl: Couldn't resolve host name"
}
],
"status": "errors",
When I only Parametric cookies by
curl -v http://127.0.0.1:8093/query/service --data-urlencode 'statement=PREPARE queryLastSeq2 FROM SELECT CURL("GET","http://192.168.199.128:4984/sg/_changes", {"header":"Cookie:SyncGatewaySession=$Cookie","data":"feed=normal&feed=normal&include_docs=false&active_only=false"}).last_seq;'
and run
curl -v http:/127.0.0.1:8093/query/service -d 'prepared="queryLastSeq2"&$Cookie="b71792a2f40c36e26bf7a0bfd1e745f520521711"'
I got the following error
"errors": [
{
"code": 4050,
"msg": "Unrecognizable prepared statement - cause: Invalid prepared stmt \"\u003cbinary (65 b)\u003e\""
}
],
"status": "fatal",
notice:
If I don’t Parametric address and cookies by
curl -v http://127.0.0.1:8093/query/service --data-urlencode 'statement=PREPARE queryLastSeq3 FROM SELECT CURL("GET","http://192.168.199.128:4984/sg/_changes", {"header":"Cookie:SyncGatewaySession=b71792a2f40c36e26bf7a0bfd1e745f520521711","data":"feed=normal&feed=normal&include_docs=false&active_only=false"}).last_seq;'
it works fine.
may be I need Parametric any parameter in header or data.