SOQL queries support Apex variable binding. You can use an Apex variable and filter SOQL records against the value of that variable.
string strName = ‘John Snow’;
List<Position__c> positionList = [SELECT Name
FROM Position__c WHERE Name =: strName];