Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2002
    Posts
    2

    Unanswered: 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

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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/

  3. #3
    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

  4. #4
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Available since 11.70 I think:
    SET EXPLAIN ON AVOID_EXECUTE;
    your SQL statement
    The original purpose is to provide you wwith the query plan, but it will check the syntax and do not execute the query

    Happy new year :-)

    Eric

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •