parameterize function for sql routing function