+ Start a Discussion

constructor calling from batch

hi everyone,
kindly see code provided in this link.

In this what would the value of Query?
what would be value of records in Scope?
Actully am querying from different objects...which will take fisrt if both queries fetched the records.
could anyone explain?
your help would be appreciated
Raj VakatiRaj Vakati
The query will be based on how you are calling the batch by using the constructor 
Id batchInstanceId = Database.executeBatch(new DemoBatch(), 5)===>> Query will be 

Query='select accountid,Account.name from Contact where account.closeddate=today and createdate=today'

what would be the scope records...are they related to query1/query2 
batchInstanceId1= Database.executeBatch(new DemoBatch('select id,name,email from Account where createddate=today'), 5)===> Query will be 
'select id,name,email from Account where createddate=today')

Your scope will be the list of account  which you query will be returned and you are seeing the values to 5