Solved

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

Posted on 1998-11-09
5
144 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
Comment Utility
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
Comment Utility
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
Comment Utility
Look in the help under "Heterogenous queries"
0
 
LVL 1

Author Comment

by:DValery
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

7 Experts available now in Live!

Get 1:1 Help Now