Solved

"Select .. From.." in TQuery for many database files...

Posted on 1998-11-09
5
149 Views
Last Modified: 2010-04-04
Hi, Experts!
I'm making special SQL builder for 3 database files of IB Database. I want to know how to write down "Select ... From" command for 3 database IB files without use Aliases.
I use 3 TDataBase components for access IB DataBase files.
0
Comment
Question by:DValery
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:FreeLogin
ID: 1346329
hello DValery.
What do you mean by "Without using Aliases" ?

What is sure, is that you can solve your problem like this :

Select ......
from :Alias1:Table1,:Alias2:Table2,:Alias3:Table3
where ....

where :Alias1: is the name of the first alias inserted between ::


regards
                FreeLogin
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1346330
Hi  DValery,

the Database-property of your Query should have the Alias which shows to your Interbase Database

The Sql-Statement couls be shown as follows

Select a.field, b.field, c.field,... from TableA , TableB b, TableC c where a.Field = b.Field and b.Field=c.Field order by a.field

the word field should contain your fieldnames, by the where-clause the typs of fields should be the same, in order clause you select the sortorder.

meikl
0
 
LVL 1

Expert Comment

by:EmmDieh
ID: 1346331
Look in the help under "Heterogenous queries"
0
 
LVL 1

Author Comment

by:DValery
ID: 1346332
Thanks EmmDieh, for old true: "...read the documentation".
The Help say me:
..
As an alternative to using a BDE alias to specify the database in a heterogeneous query, you can use a TDatabase component. Configure the TDatabase as normal to point to the database, set the TDatabase.DatabaseName to an arbitrary but unique value, and then use that value in the SQL statement instead of a BDE alias name.
..
It is I looking for...
EmmDieh, you can to get 50 points...
0
 
LVL 1

Accepted Solution

by:
EmmDieh earned 50 total points
ID: 1346333
Thanks,
but keep in mind that as far as I know result sets from
multiple databases in heterogenous queries are joined
on the client side which may result in a really low
performance, because a the rows have to be transmitted
over the network.
You can check this with SQL-Monitor.
Consider using one database instead.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question