0

I try to query Oracle Service Cloud v1.3. When using ROQL with a single WHERE condition it works. But when adding another condition (separated with AND) it complains with:

OSC-CREST-00025 [Bad Request] Bad Request: near "and": syntax error

URL: .../answers?orderBy=updatedTime%3Adesc&limit=10000&q=language%3D5+AND+updatedTime+after+%272019-04-03%27&fields=id%2Clanguage&offset=0

I believe "AND" is a valid ROQL keyword. Why is it complaining?

Slawa
  • 1,141
  • 15
  • 21
  • https://docs.oracle.com/en/cloud/saas/service/18a/cxsvc/c_osvc_roql_object_queries.html - ROQL documentation I used. – Slawa Apr 10 '19 at 16:31
  • 1
    [This example](https://docs.oracle.com/en/cloud/saas/service/18a/cxsvc/c_osvc_roql_object_queries.html) shows spaces where you have `+`; perhaps those are being interpreted as addition and it's unhappy with `5+AND` as a calculation? What happens if you just use spaces (or `%20` since you're escaping other entities) instead of `+`? – Alex Poole Apr 10 '19 at 17:00

1 Answers1

2

Did you try put space before and after AND in url:

URL: .../answers?orderBy=updatedTime%3Adesc&limit=10000&q=language%3D5+%20AND%20+updatedTime+after+%272019-04-03%27&fields=id%2Clanguage&offset=0

Mladen S
  • 93
  • 7
  • The "+" in the URL is the space. Anyway, I've tried with %20 but it didn't help. – Slawa Apr 11 '19 at 07:12
  • 1
    It worked when I replaced ALL "+" with %20. Oracle seems picky and only accepts spaces encoded with RFC3986. Thank you everybody! – Slawa Apr 11 '19 at 07:18