RE: SELECT QUERY between 2 differend databases on the same server
Posted in 2000
Create a synonym(s) in database A which points to a table(s) in database B.
(Database B can be anywhere on your WAN).
Then all your tables you require are in database A.
Perform the select as normal.
MW
-----Original Message-----
From: owner-informix-list@iiug.iiug.org
[mailto:owner-informix-list@iiug.iiug.org]On Behalf Of Richard Krenek
Sent: Thursday, June 15, 2000 6:11 AM
To: informix-list@iiug.org
Subject: SELECT QUERY between 2 differend databases on the same server
Is it possible to do a query that touches 2 different tables in
different databases on the same server. Here is the SQL statment that
they want to use but they want the table doc_update to be in a different
database than doc_master.
SQL INSERT INTO doc_update
(doc_global_id, fam_global_id, fam_num_gid, fam_sn,
source, kind, act_hist_ind, doc_key_date, pub_num,
rev_sn, sfx_sn, in_lieu_of, most_active, common_gid)
SELECT doc_global_id, fam_global_id, fam_num_gid, fam_sn,
source, kind, act_hist_ind, doc_key_date, pub_num,
rev_sn, sfx_sn, in_lieu_of, most_active, common_gid
FROM doc_master
WHERE act_hist_ind = 'A'
Why we want to do this you ask!! Because I was asked to. We are
comparing times to do certain queries/inserts between 4 Databases
(OpenIngres/Informix/DB2/Oracle) We are using Informix 7.(forgot this
part). If we do choose Informix it will be replacing OpenIngres that has
its data spread accross 20 databases and they most likely want to copy
that structure to Informix and I need to know if that is possible (or
desirable).
Thanks,
Richard Krenek