change query record to variable