SQL Parser

19 April,2013 by Tom Collins

Question : In my application, I am receiving SQL from other application. I want to validate that SQL text on my client. I don’t want to add the performance overhead to the database , what options are available?

Answer:  Parsing SQL code is an important part of code development . Parsing is the process of  analysing a string of symbols ,  based on the syntax rules.  There a number of options available and  will depend on your circumstances.


Option 1Make a DB2 call and allow the database to validate the SQL code. If you don’t want the overhead , then restore a copy of the database onto a lower environment



Option 2 – Download a SQL Parser


General SQL Parser  - Loads of features , but the documentation is poor. It’s a commercial tool but there is a free download


TSql100Parser Class in .net4 – Useful for SQL Server.Read More


JSQLParser – Creates Java classes hierarchy. Download


Hibernate – Not a parser but uses ANTLR for sql parsing



Read More


Trace sql statements in DB2 database  

DB2 Query Tuning – db2expln


Author: Rambler(http://www.dba-db2.com)


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on SQL Parser

Comments are moderated, and will not appear until the author has approved them.

dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright