How to select data from server and insert it into another server in informix DB

981 Views Asked by At

If i have two tables with the same structure Table1,Table2 in different databases DB1,DB2 in two different servers S1 And S2.

How to Select from Table1 and Insert Into Table2 with a simple query ?

I try to execute the following but in vain:

INSERT INTO  DB2:Table2
SELECT * FROM DB1@S1:Table1

I get the following error :

enter image description here

1

There are 1 best solutions below

0
On

If you are connecting to S1 (informix Server 1) the SQL will be executed in that server, which means S1 will need to know where S2 is.

Basically make sure that there is a S2 defined in the sqlhosts file used in S1 (and that you can connect to S2 using the same user you are connecting to S1)

It's not enough to have S1 and S2 defined in the client 'sqlhosts' (server studio) as it is the Informix server (not the client) who will do the connection to S2 for the insert