PDA

View Full Version : SQL syntax checking


Dene
06-13-02, 13:25
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!

Thanks,

Dene

r937
06-20-02, 11:49
mimer (a proprietary database unrelated to informix) has an online sql validator at http://developer.mimer.se/validator/index.htm -- this will check your sql for valid syntax according to the sql-92 or sql-99 standards

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)

change
select foo from bar where conditions
to
select foo from bar where 0=1 and (conditions)

rudy
http://rudy.ca/

ladwig
06-21-02, 03:44
I have installed Informix WGS on Winnt. There is an sqleditor(for example sqleditor300) included. You can connect to an Informix DB(Unixserver or Winxx System), run sql comands, or just check them.