cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member185199
Contributor
0 Kudos

Hi Alex,

I think that you looking for the EBNF to use it as a sort of exercise? I dont know any source where to get it from but, be aware if you speak about IQ ist not nessecerly T-SQL but might be WATCOM SQL (hope this ist still true, haven't used IQ a while?)

but for TSQl use http://msdn.microsoft.com/en-us/library/ff848766.aspx as a start because SQL-Server is pretty close to ASE, so you have to find only the diffrences betwen MS and SAP then.

HTH

dj

Former Member
0 Kudos

Good evening

First, thanks to all of you for your suggestions. I think I'll try it with the TSQL- or Watcom-Grammar. I thought it would be nice to build a tool for my colleagues to lower their workload. We're running a lot of really big lists of statements and I'm looking for a way, to parameterize the blocks of SQL code, so you can use them like lego-bricks...  

Best regards

Alex

Answers (1)

Answers (1)

markmumy
Advisor
Advisor
0 Kudos

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 Kudos

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

c_baker
Employee
Employee
0 Kudos


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