Board index » delphi » "merging" several databases

"merging" several databases

Here's the deal:

Database #1 has fields B, C, D, E
Database #2 has fields A, B

How can I create another database by linking the two databases along
field B, creating a database with A, B, C, D, E?

Perferably without any programming, like through paradox or something.
Course, if no other solution exists, I will actually program.

--
-=PHiL=-

Sent via Deja.com http://www.deja.com/
Before you buy.

 

Re:"merging" several databases


Quote
zaij...@my-deja.com wrote:

: Database #1 has fields B, C, D, E
: Database #2 has fields A, B

: How can I create another database by linking the two databases along
: field B, creating a database with A, B, C, D, E?

: Perferably without any programming, like through paradox or something.
: Course, if no other solution exists, I will actually program.

No, no, we Delphi users avoid distasteful things like programming
whenever possible. :)

If you're already familiar with Paradox, use the tools you know.
In either Paradox for Windows, or in Database Desktop that comes
with Delphi, create your QBE query as you would for Paradox.
Then, from the menu, choose "Query - Show SQL."  This will auto-
generate the equivalent SQL code.  You may need to fine-tune
the SQL query for greatest efficiency, but this gives you some
working SQL code to start from.
--
Rick Carter
carte...@email.uc.edu

Re:"merging" several databases


What you are describing is a JOIN query.  For example:

   SELECT DISTINCT B, C, D, E, A  
   FROM TABLE1 JOIN TABLE2 ON TABLE1.B = TABLE2.B

This will produce a result of every unique combination of rows that can
exist.  For example, if a particular value of B occurs twice in table1
and three times in table2, up to six (3*2) "distinct" (i.e. unique) rows
representing various combinations of these records could appear in the
output.

Quote
zaij...@my-deja.com wrote:

> Here's the deal:

> Database #1 has fields B, C, D, E
> Database #2 has fields A, B

> How can I create another database by linking the two databases along
> field B, creating a database with A, B, C, D, E?

> Perferably without any programming, like through paradox or something.
> Course, if no other solution exists, I will actually program.

------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
mailto:i...@sundialservices.com  (PGP public key available.)
Quote
> Fast(!), automatic table-repair with two clicks of the mouse!
> ChimneySweep(R):  "Click click, it's fixed!" {tm}
> http://www.sundialservices.com/products/chimneysweep

Re:"merging" several databases


That's not exactly what I had in mind - I was thinking more along the
lines of how to combine the two database files I have into one database
file, so that in Delphi, I don't have to use multiple ttables and then
link them together.

In article <8bl4uc$c3...@news.ececs.uc.edu>,

Quote
carte...@email.uc.edu wrote:
> zaij...@my-deja.com wrote:
> : Database #1 has fields B, C, D, E
> : Database #2 has fields A, B

> : How can I create another database by linking the two databases along
> : field B, creating a database with A, B, C, D, E?

> : Perferably without any programming, like through paradox or
something.
> : Course, if no other solution exists, I will actually program.

> No, no, we Delphi users avoid distasteful things like programming
> whenever possible. :)

> If you're already familiar with Paradox, use the tools you know.
> In either Paradox for Windows, or in Database Desktop that comes
> with Delphi, create your QBE query as you would for Paradox.
> Then, from the menu, choose "Query - Show SQL." This will auto-
> generate the equivalent SQL code. You may need to fine-tune
> the SQL query for greatest efficiency, but this gives you some
> working SQL code to start from.
> --
> Rick Carter
> carte...@email.uc.edu

--
-=PHiL=-

Sent via Deja.com http://www.deja.com/
Before you buy.

Re:"merging" several databases


Select a.t2,b.t1,c.t1,d.t1,e.t1
FROM Table1.t1,Table2.t2
WHERE (b.t1=b.t2)

Hope this helps...
Oh yes, the only way is SQL
---
FA Beli/Fleet Commader/PLT Loch/ISF
[MoIx4][IDMx2][SSx2][GS][MoH]
ISF-1998030106
http://www.imperialstarfleet.com
---
Jedi Master Beli/ATD/Dark Council/Advisor of SoH
[VC][CD][BTM][STM][GTM][GSC]
http://www.sauron.co.yu/atd
---
http://www.sauron.co.yu
ICQ No. 1878554

Quote
----- Original Message -----
From: <zaij...@my-deja.com>
To: <beli-n...@fido.org.yu>
Sent: Sunday, 26 March, 2000 6:47 AM
Subject: "merging" several databases

> Here's the deal:

> Database #1 has fields B, C, D, E
> Database #2 has fields A, B

> How can I create another database by linking the two databases along
> field B, creating a database with A, B, C, D, E?

> Perferably without any programming, like through paradox or something.
> Course, if no other solution exists, I will actually program.

> --
> -=PHiL=-

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Re:"merging" several databases


Quote
zaij...@my-deja.com wrote:

: That's not exactly what I had in mind - I was thinking more along the
: lines of how to combine the two database files I have into one database
: file, so that in Delphi, I don't have to use multiple ttables and then
: link them together.

Well, several people have given you the query.  If you run that query
in Paradox or Database Desktop, it will produce an "Answer Table"
with the results (by default, :PRIV:ANSWER.DB).  Copy and rename that
table (or specify a different table name in 'Query Options' to start
with), and you'll have it.  In pure Delphi, you could use a
batchMove component to move the query result to the table you want.
--
Rick Carter
carte...@email.uc.edu

Re:"merging" several databases


I am a complete SQL novice,so how would I go about making this program
using delphi?

In article <38DE26E0.2...@sundialservices.com>,

Quote
i...@sundialservices.com wrote:
> What you are describing is a JOIN query. For example:

> SELECT DISTINCT B, C, D, E, A
> FROM TABLE1 JOIN TABLE2 ON TABLE1.B = TABLE2.B

> This will produce a result of every unique combination of rows that
can
> exist. For example, if a particular value of B occurs twice in table1
> and three times in table2, up to six (3*2) "distinct" (i.e. unique)
rows
> representing various combinations of these records could appear in the
> output.

> zaij...@my-deja.com wrote:

> > Here's the deal:

> > Database #1 has fields B, C, D, E
> > Database #2 has fields A, B

> > How can I create another database by linking the two databases along
> > field B, creating a database with A, B, C, D, E?

> > Perferably without any programming, like through paradox or
something.
> > Course, if no other solution exists, I will actually program.

> ------------------------------------------------------------------
> Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
> mailto:i...@sundialservices.com (PGP public key available.)
> > Fast(!), automatic table-repair with two clicks of the mouse!
> > ChimneySweep(R): "Click click, it's fixed!" {tm}
> > http://www.sundialservices.com/products/chimneysweep

--
-=PHiL=-

Sent via Deja.com http://www.deja.com/
Before you buy.

Other Threads