cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sybase IQ (E)BNF Grammar or Parser (Java)

Former Member
0 Likes
436

Good Evening

I'm looking for either a parser or the grammar description in (e)bnf for Sybase IQ T-SQL. I'm tinkering around with a small project for my colleagues and for this I need the possibility to check any block of Sybase IQ T-SQL for correctness.

Could somebody please give me a hint? I spent the best of this Afternoon searching the web but without finding something useful.

Thank you very much.

Best regards

Alex

View Entire Topic
markmumy
Product and Topic Expert
Product and Topic Expert
0 Likes

I don't know of any parser that is available externally.  One option would be to download the IQ Express Edition.  It is a free version of IQ, with limitations like no support, but you could use that to check the SQL.  For instance, if you run the code into IQ via the dbisql utility you can specify the -n option to have it just check syntax but not run anything.

The Express Edition is available here: SAP Sybase IQ free downloads: Choose the right fit for you

Mark

Former Member
0 Likes

Hello Mark

Thank you very much for your suggestions, but unfortunetaley an external tool is not what I'm looking for. I need either an parser - preferably written in Java - I can embedd in my code or the (e)bnf grammar to build my own parser.



Have a nice weekend and best regards


Alex

ChrisBaker
Product and Topic Expert
Product and Topic Expert
0 Likes


Alexander,

Although I am not aware, such BNF documents might be considered proprietary.  You could however start with one of the BNF files related to the standards SQL-99, SQL-2003, etc and alter it as necessary.

Documentation on differences between the SQL used in IQ and other SQL dialects can be found at:

Differences from Other SQL Dialects

in the IQ docs.

In addition, IQ provides a system procedure 'sa_ansi_standard_packages' that can be used to deterimine how a specific SQL statement varies from the standard.  Using this you might be able to manually alter a base BNF definition.

HTH

Chris