SOQL queries support Apex variable binding. You can use an Apex variable and filter SOQL records against the value of that variable.

tring strName = ‘John Snow’;

List<Position__c> positionList = [SELECT Name

FROM Position__c  WHERE Name =: strName];

Our Recent Blog

Share This Post