If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > SQL syntax checking

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-13-02, 12:25
Dene Dene is offline
Registered User
 
Join Date: Jun 2002
Posts: 2
SQL syntax checking

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
Reply With Quote
  #2 (permalink)  
Old 06-20-02, 10:49
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
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/
Reply With Quote
  #3 (permalink)  
Old 06-21-02, 02:44
ladwig ladwig is offline
Registered User
 
Join Date: May 2002
Location: Osnabrueck Germany
Posts: 59
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.
__________________
Juergen Ladwig
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On