function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Satish PrajapatSatish Prajapat 

Passing dynamic value in where clause in SOQL in bigObject

Hello experts,
I am trying to hit data using SOQL on bigobject,
Where accId:
public String accId;
List<BigObjectTaskData__b> tempList =  [select id from BigObjectTaskData__b where whoId__c =: accId];

So, I am getting error in where clause(where whoId__c =: accId)
If I do not use (where whoId__c =: accId) it works
And if use where clause like (where whoId__c ='0035D000006FdfWQAS'), So it works well.

help me, how to pass "accId" variable value in where clause??
Best Answer chosen by Satish Prajapat
Satish PrajapatSatish Prajapat
We can pass the dynamic value in SOQL query Database.getQueryLocator('<Your query in string format>');
write a string query dynamically and execute that string query.