Does anyone know of an easy way to syntax check SQL without the statements having to run?
I'm writing shell scripts containing SQL, and it's a pain to wait several minutes for valid queries to complete only to find syntax errors later on. If there is a way to syntax check the whole lot first my life would be easier!
another option is to take your query and add a condition to the WHERE clause that will guarantee no rows returned -- it will still run, but it should run extremely quickly (if the optimizer is doing its job)
select foo from bar where conditions
select foo from bar where 0=1 and (conditions)