Make SQL queries more flexible on bound variable types