Re: Automatic SQL query builder

From: Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl>
Date: 12 Oct 2001 08:10:56 GMT
Message-ID: <9q68ig$amh$1_at_news.tue.nl>


Jeff Zucker wrote:
>
> [...] But I am attempting to do something quite a bit more
> complex. For example (and this example was submitted by a user with a
> need for it) suppose you have a series of SQL statement strings and you
> want to perform a regular transformation on e.g. all of the column names
> -- you can submit the string to parse() and get back a data structure,
> perform the transformation on the relevant parts of the data structure
> then feed that structure to build() and get back a rebuilt SQL string
> that contains the newly transformed information. For that, one needs to
> pay attention to all of the details of the syntax, including things like
> the difference between explicit and implicit joins (even though the end
> result of the join will be the same). Or should we say that the end
> result *might* be the same since some rdbms's will optimize joins
> differently depending on how they are presented.

I'm not sure what you mean by "regular transformations" here. Is that "regular" as in regular expressions? Let's see if I understand you correctly. You have a data structure that represents SQL queries and you have methods/functions that parse strings into that data structure and methods that translate the data structure back to strings. And then you also seem to have methods that manipulate the data structure. Now I can imagine two requirements here and I'm not sure which one you mean. One is that the meaning of the query should remain the same, and the other is that the structure should always represent a valid SQL query. Is that what you are asking?

-- 
  Jan Hidders
Received on Fri Oct 12 2001 - 10:10:56 CEST

Original text of this message