Skip to main content
Hi,

I am not able to run the batch for the below quesry.

i am getting below error messages after modifications also. kindly help.

1. First error: Only variable references are allowed in dynamic SOQL/SOSL.

2. First error: unexpected token: '='

3. IF i mention IN instead of = i got error message like First error: unexpected token: 'IN'

4. First error: expecting a colon, found 'NULLStatus__c'

5.First error: Too many query rows: 50001 (Main Error)

I want to  get all the ACTIVE status customers from orders.

Code:

global with sharing class Batch_ProductVolumeTarget_Stats implements Database.Batchable<sObject>

{

  public class X_Exception extends Exception{}

  global Database.QueryLocator start(Database.BatchableContext BC)

  {

    string  strQuery =

      ' select  Id'  +

      ' from     Order__c ' +

      ' where    Customer__C= NULL';

      

    return Database.getQueryLocator(strQuery);

  }

Regards,

Sarma
3 réponses
  1. 27 janv. 2018, 17:01

    string strQuery =' select Id'+

    ' from Order__c'+

    ' where Customer__C = NULL';

    return Database.getQueryLocator(strQuery);