Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 如何从服务器中选择数据并将其插入informix DB中的另一台服务器_Sql_Database_Informix_Select Insert - Fatal编程技术网

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

Sql 如何从服务器中选择数据并将其插入informix DB中的另一台服务器,sql,database,informix,select-insert,Sql,Database,Informix,Select Insert,如果我在不同的数据库DB1中有两个结构相同的表Table1、Table2,在两个不同的服务器S1和S2中有DB2 如何通过简单的查询从表1中选择并插入表2 我试图执行以下操作,但徒劳无功: INSERT INTO DB2:Table2 SELECT * FROM DB1@S1:Table1 我得到以下错误: 如果您连接到S1(informix服务器1),SQL将在该服务器中执行,这意味着S1需要知道S2在哪里 基本上确保在S1中使用的sqlhosts文件中定义了S2(并且可以使用连接到S1

如果我在不同的数据库
DB1中有两个结构相同的表
Table1、Table2
,在两个不同的服务器
S1和S2
中有DB2

如何通过简单的查询从表1中选择并插入表2

我试图执行以下操作,但徒劳无功:

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

我得到以下错误:


如果您连接到S1(informix服务器1),SQL将在该服务器中执行,这意味着S1需要知道S2在哪里

基本上确保在S1中使用的sqlhosts文件中定义了S2(并且可以使用连接到S1的同一用户连接到S2)


仅在客户端“sqlhosts”(server studio)中定义S1和S2是不够的,因为将为插入连接S2的是Informix服务器(而不是客户端)

如果您连接到S1(Informix服务器1),SQL将在该服务器中执行,这意味着S1需要知道S2在哪里

基本上确保在S1中使用的sqlhosts文件中定义了S2(并且可以使用连接到S1的同一用户连接到S2)


仅在客户端“sqlhosts”(serverstudio)中定义S1和S2是不够的,因为它是Informix服务器(而不是客户端)谁将连接到S2进行插入

可能会有帮助?@Scath:链接涉及
sqlserver
not
informix
可能会有帮助?@Scath:链接涉及
sqlserver
not
informix