Reputation: 2783
I am looking for something, where I can validate the DB2-SQL Text that I am receiving on Client end. I do not want to make a DB call just to validate SQL Text. Any parser available to validate DB2 SQL texts ? I am using C#.
Upvotes: 1
Views: 2187
Reputation: 27478
You should be able to "prepare" the statement without executing it.
SQL parsers are truly difficult beasts to write and you will never get it 100% right, besides even if you can scan for correct syntax you have no idea what tables and views are currently defined in the target system.
So assuming its just "SELECT" statements you want to check just "PREPARE" them and check for errors, but, don't execute.
Upvotes: 1