Solved

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

Posted on 1998-11-09
5
148 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi and Access based Enumeration 9 78
Tvertscrollbox like a whatsapp layout 5 53
enhance the following code 3 42
Slow Restore if incremental backups using RDiff.exe 4 39
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

733 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