Re: Automatic SQL query builder

From: Jaroslaw Tomczak <Jaroslaw.Tomczak_at_CCC.Chemie.Uni-Erlangen.DE>
Date: Fri, 12 Oct 2001 13:32:10 +0200
Message-ID: <3BC6D4BA.4B5F7CFE_at_CCC.Chemie.Uni-Erlangen.DE>


Jan Hidders wrote:
>
> Jaroslaw Tomczak wrote:
> > Hi,
> >
> > As a part o bigger project I develop a kind of automatic query builder.
> > This application receives as input:
> > 1. A list of search criteria -- field names, their locations within
> > appropriate tables and desired values
> > 2. A list of fields that should be returned by query
> > 3. Fields used for sorting results
> > 4. Description of tables' relationships.
> > As the results the application returns a correctly formulated SQL query.
> >
> > In trivial cases it is quite easy to analyse the above input and build
> > appropriate queries, but many problems arises when one tries to
> > implement joins and subqueries.
> >
> > I'm simply looking for some papers, reports, links that would relate to
> > the problem described above.
>
> If I understand your description of the input correctly you don't need
> any subqueries (and explicit joins are not necessary in SQL). In that
> case the traslation is trival: put all the mentioned tables in the
> from-clause, the select and the join-conditions in the where clause,
> the selected fields in the select-clause and the order conditions in
> the order-by-clause.

You are probably right. When I was trying an approach similar to the described above, I simply forgot to put all the tables involved in the from-clause.

Thanks

-- 
;; Jaroslaw Tomczak
(let ((Computer-Chemie-Centrum 'http://www2.ccc.uni-erlangen.de))
     (visit Computer-Chemie-Centrum))
Received on Fri Oct 12 2001 - 13:32:10 CEST

Original text of this message