Re: Call for an API standard for SQL statements

From: Tony Douglas <tonyisyourpal_at_netscape.net>
Date: 29 Oct 2004 18:33:17 -0700
Message-ID: <bcb8c360.0410291733.14dd8652_at_posting.google.com>


"Laconic2" <laconic2_at_comcast.net> wrote in message news:<M86dnXjKC5dgqR_cRVn-rQ_at_comcast.com>...
> "Tony Douglas" <tonyisyourpal_at_netscape.net> wrote in message
> news:bcb8c360.0410281347.22552922_at_posting.google.com...
>
> > Could this thread be summarised as, "I want an object model for the
> > abstract syntax tree of an idealised SQL which can then be formed into
> > SQL for a particular DBMS implementation" ?
>
> If you will look in detail at what a cost based optimizer does with the
> query, in order to begin generating a tree of alternative solutions, I
> think you will find that it does something that might be described by the
> above wording.

Probably any SQL parser will have to construct an AST to attempt doing anything with a query, whether the optimiser is cost-based or rule-based. Generally after the AST is produced, multiple query execution plans (which may or may not be trees) will be produced and evaluated. What I *think* the OP wanted was to construct some form of object model for an idealised SQL AST, which could then be materialised into SQL for some or other actual SQL implementation, rather than building up text strings. The OP is likely to go mad in the attempt, from what I've seen of parsers that attempt significant amounts of SQL-92 compliance, never mind -99 or -2003.

Cheers,

  • Tony
Received on Sat Oct 30 2004 - 03:33:17 CEST

Original text of this message