Board index » delphi » Is is ImPossible Query to Result Query, Really?

Is is ImPossible Query to Result Query, Really?

I've read that it is impossible to Use Query to Query Result.
Really?

Is another solution?
I want to make a search system for quering to prior query result.
I saw that kind of search system some database (but it was not delphi
appl.) Is there anyone who know the solution?

 

Re:Is is ImPossible Query to Result Query, Really?


I had the same problem, too.  What I did to resolve this, was to use a
TTable to create a temporary table.
with Table1.FieldDefs do  begin
  Clear;
  Add(  ------------->  Insert field  <-----------);
  Add(  ------------->  Insert field  <-----------);
  Add(  ------------->  Insert field  <-----------);
end;
Table1.CreateTable;

I ran the first query, and used TBatchMove to append the results of the
query into Table1.  Then I can query the temp table.

Then OnFormClose, call the Table1.DeleteTable;

This is cumbersome, but it works good.

Kurt

Quote
song jong kil wrote:
> I've read that it is impossible to Use Query to Query Result.
> Really?

> Is another solution?
> I want to make a search system for quering to prior query result.
> I saw that kind of search system some database (but it was not delphi
> appl.) Is there anyone who know the solution?

Re:Is is ImPossible Query to Result Query, Really?


Quote
song jong kil wrote:
> I've read that it is impossible to Use Query to Query Result.
> Really?

That's basically a refined query, just add more criterias to your query
if the result is not satisfying. Otherwise you could use BatchMove and
the requery that local table.

Kind Regards
Max

Quote
> Is another solution?
> I want to make a search system for quering to prior query result.
> I saw that kind of search system some database (but it was not delphi
> appl.) Is there anyone who know the solution?

--

=======================
MBS Software Co., Ltd.
M.-Ph. Blickenstorfer
67/359 Mooban Tantong 5
Phuket 83000
Thailand
Tel/Fax : +66 76 242 516
e-mail   :  m...@loxinfo.co.th
=======================

Re:Is is ImPossible Query to Result Query, Really?


Save the query results in a temporary table using the BatchMove component or
DbiMakePermanent.  Then query the temporary table.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:Is is ImPossible Query to Result Query, Really?


Quote
>I've read that it is impossible to Use Query to Query Result.
>Really?
Correct

>Is another solution?

You can write a query out to a table with a little code
 DbiMakePermanent(query1.handle, 'temp.db',true);
then use that table in the second query

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Other Threads