0

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

2

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.