Re: TQuery question



fu wrote:

One option was to take the query, prepare its
SQL, clear the fields, run it just to get the fields, copy the fields,
close the query, add the copied fields and the necessary fields for
the results and open the query again. However, this is so ugly that I
am really searching for a finer solution.

I do not see what is so particulary ugly in that approach.
You can easily write that functionality inside a separate procedure or
function. And when the code is in there you can mostly forget it. That
way it should not look so 'ugly' any more, when viewed from your main
program framework.

I'm not sure if I quite understood your problem in the first hand. Was
the problem to get the all the Field names from each of each of the
called physical disk tables, before you build your SQL clause? These
should be more simple ways to get all the Field names from a disk table.

But if you only need those fields that your SQL has uses, then maybe
your current code is all right for that. There could be better and more
neat ways of course, I'm not sure, I did not completely get the whole
problem or idea.
Ege
.


Quantcast