Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Memory leak using records in a TVirtualStringTree 11 109
indy tidtcpclient threading issue 8 63
Simple Delphi Question 9 83
Delphi: how to implement a User Shortcut mapper? 1 95
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now