execute immediate 'select count(1) from DUAL
where EXISTS
( SELECT 1 from samples
where samplecode = :sample code
and auditflag = 0
and ' || varFilterString || ')'
into varResult
using varSampleCode;