2

I am trying to use Bulk query 2.0 and trying to submit a job via workbench for the following query,

"query" : "select id, name from Account where name like 'Microsoft%' OR name like 'kumar%'",

I am getting the following error message , however query works with AND operator, Is there any limitation of bulk query with OR operator and also i see some extra condition that gets added in error message something like "and Id >= '001000000000000'", I have no idea whats this .. can someone please help

"errorMessage: Failure during batch processing: ClientInputError : Query processing exception: MALFORMED_QUERY: 'Microsoft%' OR name like 'kumar%' and Id >= '001000000000000' and ^ ERROR at Row:1:Column:81 unexpected token: and"

1 Answer 1

3

Wrap your conditions in parenthesis to define the order

{
  "operation": "query",
  "query": "SELECT Id, Name FROM Account where (name like 'Microsoft%' OR name like 'kumar%') and Id >= '001000000000000'"
}
2
  • 1
    great . thanks .. it works ,, not sure why salesforce is adding "and Id >= '001000000000000'" Commented Sep 24, 2020 at 16:04
  • 1
    Hello! I'm having a similar issue. In my case, I'm querying Contacts and I get "Id >= '003000000000000'" appended to the end of the query. What is the reason for this condition being automatically added? Thanks!
    – bonzi
    Commented Nov 19, 2021 at 9:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .