简体   繁体   English

如何从服务器选择数据并将其插入informix DB中的另一个服务器

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

If i have two tables with the same structure Table1,Table2 in different databases DB1,DB2 in two different servers S1 And S2 . 如果我在两个不同的服务器S1 And S2中的不同数据库DB1,DB2中有两个具有相同结构Table1,Table2

How to Select from Table1 and Insert Into Table2 with a simple query ? 如何从Table1中选择并通过简单查询插入到Table2中

I try to execute the following but in vain: 我尝试执行以下操作,但没有成功:

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

I get the following error : 我收到以下错误:

在此处输入图片说明

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. 如果连接到S1(informix服务器1),则SQL将在该服务器上执行,这意味着S1将需要知道S2在哪里。

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) 基本上,请确保在S1中使用的sqlhosts文件中定义了一个S2(并且您可以使用连接到S1的同一用户连接到S2)

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 在客户机“ sqlhosts”(服务器工作室)中定义S1和S2是不够的,因为Informix服务器(不是客户机)将为插入插入到S2的连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM