Re: [h2] How to access the H2 parser and AST?

2020-10-07 Thread Andreas Reichel
On Wed, 2020-10-07 at 15:57 +0200, Noel Grandin wrote: > We use a top-down recursive descent parser, and we have separate > documentation files which we pass through a build-time > tool to generate BNF-type diagrams. This one, right? public static Bnf getInstance(Reader csv) throws

Re: [h2] How to access the H2 parser and AST?

2020-10-07 Thread Noel Grandin
On 2020/10/07 3:54 pm, Andreas Reichel wrote: but please let me ask further: How exactly is the SQL syntax and grammar defined/specified for H2? Is there a BNF file somewhere? Or is it all hard-coded in Java only? We use a top-down recursive descent parser, and we have separate

Re: [h2] How to access the H2 parser and AST?

2020-10-07 Thread Andreas Reichel
Thank you Noel, but please let me ask further: How exactly is the SQL syntax and grammar defined/specified for H2? Is there a BNF file somewhere? Or is it all hard-coded in Java only? I mean, somehow you create your excellent online documentation with the BNF diagrams. Cheers Andreas -- You

Re: [h2] How to access the H2 parser and AST?

2020-10-07 Thread Noel Grandin
On 2020/10/07 2:37 pm, Andreas Reichel wrote: can we access the H2 internal Parse (which should know best) and retrieve the Query AST? I did not find anything in the API documentation. No, the internal parser doesn't generate a real AST, it produces something that roughly half-way

[h2] Re: H2 to Oracle migration

2020-10-07 Thread Andreas Reichel
Hello Dipesh, It all depends on your H2 version and particular syntax you have used. We run our Database Applications on H2, Oracle and SQL Server and so develop the schemas and queries with maximum compatibility in mind. Especially when you use Oracle-Mode, H2 should not be very different from

[h2] Re: age in another column

2020-10-07 Thread Andreas Reichel
Siegfried, you will need to calculate the Date Difference in days divided by 365 as shown in the following example: *select Cast({d '2019-05-04'} - {d '2019-03-12'} AS DECIMAL) /365 from dual;* Cheers Andreas On Tuesday, September 29, 2020 at 4:21:33 PM UTC+7 sieg...@skerra.net wrote: >

[h2] How to access the H2 parser and AST?

2020-10-07 Thread Andreas Reichel
Dear All, just a quick one: We use JSQLParser as a simple parser in order to get information about a query. Works, but of course it is not perfect. Now I wonder two things: 1. can we access the H2 internal Parse (which should know best) and retrieve the Query AST? I did not