Setting sql statement