Board index » delphi » HELP:Selecting data from multiple databases

HELP:Selecting data from multiple databases

Hi,

Is it possible to interactively, using SQL Explorer that comes with Delphi 5
( or anything else), set up a query that will copy/move data from one
database into the same table in another database?

Something like

insert into db1.table
select * from db2.table

Jim

 

Re:HELP:Selecting data from multiple databases


From the Delphi OLH:

Heterogeneous joins

Joins two tables from different databases.

SELECT column_list
FROM ":database_reference:table_reference",
":database_reference:table_reference"
[,":database_reference:table_reference"...]
WHERE predicate [AND predicate...]

Description
Use a heterogeneous join to join two tables that reside in different
databases. The joined tables may be of different types (like dBASE to
Paradox or Paradox to InterBase), but you can only join tables whose
database types are accessible through the BDE (local, ODBC, or SQL Links). A
hetergeneous join may be any of the joins supported by local SQL. The
difference is in the syntax for the table reference: the database containing
each table is specified in the table reference, surrounded by colons and the
whole reference enclosed in quotation marks. The database specified as part
of the table reference may be a drive and directory reference (for local
tables) or a BDE alias.

SELECT *
FROM ":DBDEMOS:customer.db" C, ":BCDEMOS:orders.db" O
WHERE (C.custno = O.custno)

<jim_ea...@mimotopes.com> schreef in bericht
news:memg3tcqh1tfp1tniib4pp289o8u6oehje@4ax.com...

Quote
> Hi,

> Is it possible to interactively, using SQL Explorer that comes with Delphi
5
> ( or anything else), set up a query that will copy/move data from one
> database into the same table in another database?

> Something like

> insert into db1.table
> select * from db2.table

> Jim

Re:HELP:Selecting data from multiple databases


Thanks for the reply, but that does not work in SQL Explorer. I could write
a small program to do what I want with a batchmove, but I would like to be
able to interactively do this and not have to write my own SQL parser.

I don't want to join data, I want to transfer data from one database to
another.

SQL c

Quote
"M.H. Avegaart" <avegaartNOS...@mccomm.nl> wrote:
>From the Delphi OLH:

>Heterogeneous joins

>Joins two tables from different databases.

>SELECT column_list
>FROM ":database_reference:table_reference",
>":database_reference:table_reference"
>[,":database_reference:table_reference"...]
>WHERE predicate [AND predicate...]

>Description
>Use a heterogeneous join to join two tables that reside in different
>databases. The joined tables may be of different types (like dBASE to
>Paradox or Paradox to InterBase), but you can only join tables whose
>database types are accessible through the BDE (local, ODBC, or SQL Links). A
>hetergeneous join may be any of the joins supported by local SQL. The
>difference is in the syntax for the table reference: the database containing
>each table is specified in the table reference, surrounded by colons and the
>whole reference enclosed in quotation marks. The database specified as part
>of the table reference may be a drive and directory reference (for local
>tables) or a BDE alias.

>SELECT *
>FROM ":DBDEMOS:customer.db" C, ":BCDEMOS:orders.db" O
>WHERE (C.custno = O.custno)

><jim_ea...@mimotopes.com> schreef in bericht
>news:memg3tcqh1tfp1tniib4pp289o8u6oehje@4ax.com...
>> Hi,

>> Is it possible to interactively, using SQL Explorer that comes with Delphi
>5
>> ( or anything else), set up a query that will copy/move data from one
>> database into the same table in another database?

>> Something like

>> insert into db1.table
>> select * from db2.table

>> Jim

Re:HELP:Selecting data from multiple databases


Quote
<jim_ea...@mimotopes.com> wrote in message

news:gpqi3tcgrjk7haudpv4qi6jjsun2glg4ss@4ax.com...

Quote
> Thanks for the reply, but that does not work in SQL Explorer. I could
write
> a small program to do what I want with a batchmove, but I would like to be
> able to interactively do this and not have to write my own SQL parser.

> I don't want to join data, I want to transfer data from one database to
> another.

Why don't you find a program that can do the exporting/importing with CSV
files. DBExplorer form RXLib demos.

--
Smola
--
"And once again, the day is saved"
(http://supersmola.tripod.com/index.htm)

Re:HELP:Selecting data from multiple databases


Thanks,

The issue is not HOW to do it, but rather CAN it be done in SQL Explorer or
any other commonly available tool. As yet no one has told me it cannot be
done with Interbase/SQL Explorer/ISQL/WISQL.

Jim

Quote
"Smola" <A...@inet.hr> wrote:

><jim_ea...@mimotopes.com> wrote in message
>news:gpqi3tcgrjk7haudpv4qi6jjsun2glg4ss@4ax.com...
>> Thanks for the reply, but that does not work in SQL Explorer. I could
>write
>> a small program to do what I want with a batchmove, but I would like to be
>> able to interactively do this and not have to write my own SQL parser.

>> I don't want to join data, I want to transfer data from one database to
>> another.

>Why don't you find a program that can do the exporting/importing with CSV
>files. DBExplorer form RXLib demos.

>--
>Smola

Other Threads