Menu

AW: [jsqlparser:discussion] SQL Offline Syntax Checks

Help
wumpz
2014-06-23
2014-06-24
  • wumpz

    wumpz - 2014-06-23

    The fork at github has statements processing included.  Look at the examples. I don't know if it is already done here at the original.

    -------- Ursprüngliche Nachricht --------
    Von: highnoon <fsshighnoon@users.sf.net> </fsshighnoon@users.sf.net>
    Datum:23.06.2014 12:24 (GMT+01:00)
    An: "[jsqlparser:discussion]" <360151@discussion.jsqlparser.p.re.sf.net>
    Betreff: [jsqlparser:discussion] SQL Offline Syntax Checks

    I am reading files that have multiple statements in them with comments. I want to verify the SQL syntax in each file.

    Example of one file:

    -- - Bubba's SQL


    INSERT INTO 'BUBBA_SQL' (id, userid, realname, displayname) VALUES ( 1000000, 'bubba@bubba.com', 'BUBBA JOE', 'Bubba');

    UPDATE 'BUBBA_SQL' set realname = 'Bubba Jean' WHERE id = 1000000;

    end Example:

    Do I have to tokenize/read each statement individually passing them to the CCJSqlParserManager to verify syntax?

    Or is there a method to allow a return of Statement[] or List from a file.

    Having to pre-parse the file before hand looks like what I need to do, but I figured I would ask.

    Thanks ahead of time. :-)

    SQL Offline Syntax Checks

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jsqlparser/discussion/360151/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     
    • highnoon

      highnoon - 2014-06-24

      Thanks, I figured it out and posted the code in help.

      I'm now running into couple of problems.
      The sql I am looking at has ` and not ' so I think that is causing a problem.

      Does JSqlParser handle Stored procedure code? aka BEGIN;

      I hate the sql I am looking at. :-(

       

      Last edit: highnoon 2014-06-24

Log in to post a comment.

MongoDB Logo MongoDB