Board index » cppbuilder » TQuery question

TQuery question


2006-03-04 10:51:15 PM
cppbuilder71
Hi,
is there a way to connect several DBs with only one query object?
TQuery *CountQuery;
CountQuery= new TQuery (this);
CountQuery->DatabaseName = "Raw";
CountQuery->DatabaseName = "slave"; -->Is This Possible???
 
 

Re:TQuery question

in your select use heterogeneous joins.
Something like
select tblA.CodeA , tblB.CodeB,Name from ":dbname1:tblname1" as tblA,
":dbname2:tblname2" as tblB [here add more dbnamestables]
where tblA.FldName = tblB.FldName
-minas
?"Cenk" < XXXX@XXXXX.COM >έγραψε στ?μήνυμα
Quote
Hi,

is there a way to connect several DBs with only one query object?

TQuery *CountQuery;
CountQuery= new TQuery (this);

CountQuery->DatabaseName = "Raw";
CountQuery->DatabaseName = "slave"; -->Is This Possible???

 

Re:TQuery question

Hi,
Is there a way to make a query populate the fields even though I have
some of my fields already entered? For example, assume I have a query
on several tables of the same structure (let's call them
'table1', ..., 'tableN'). Assume each of them have M columns:
col1, ..., colM. For an example, let them all be integers. I want to
make a new calculated fields called 'r_fun1', ..., 'r_funK', each of
which is an integer result of some functions 'fun1', ..., 'funK'. I
have these functions in my code and they are fairly complex (i.e.
cannot be done in SQL alone - they are not simple sums, averages and
such).
I need an application in which the user will choose which table it
wants to analyze and show the results in the grid. The grid should
display both the input data (col1, ..., colM) and the results
(r_fun1, ..., r_funK). 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. Anyone has an idea?
 

{smallsort}