2012-01-18 75 views
3

當我執行以下命令:通過dblink插入所有的表格是否可能?

INSERT ALL INTO [email protected]_link(columnName) VALUES (columnValue) 
SELECT columnValue FROM localTable; 

我得到一個錯誤

SQL Error: ORA-02021: DDL operations are not allowed on a remote database 02021. 00000 - "DDL operations are not allowed on a remote database" *Cause: An attempt was made to use a DDL operation on a remote database. For example, "CREATE TABLE [email protected] ...". *Action: To alter the remote database structure, you must connect to the remote database with the appropriate privileges.

需要注意的是,當我做一個普通(不是全部插入到)...插入工作過的數據庫鏈接。 (補助金有效)。

這兩個表上都沒有觸發器。

而且我明確需要INSERT ALL INTO來允許插入多個表的能力。

INSERT ALL INTO操作不允許進入數據庫鏈接表嗎?

回答

5

此消息是有點誤導,但無論如何,根據the Oracle SQL Reference

You cannot perform a multitable insert into a remote table.

+0

是的...肯定是誤導。 – vicsz 2012-01-18 21:53:08

1

Are INSERT ALL INTO operations not allowed into database link tables?

不幸的不是。注意第二個項目在此列表:

Restrictions on Multitable Inserts

You can perform multitable inserts only on tables, not on views or materialized views.

You cannot perform a multitable insert into a remote table.

You cannot specify a table collection expression when performing a multitable insert.

In a multitable insert, all of the insert_into_clauses cannot combine to specify more than 999 target columns.

Multitable inserts are not parallelized in a Real Application Clusters environment, or if any target table is index organized, or if any target table has a bitmap index defined on it.

Plan stability is not supported for multitable insert statements.

The subquery of the multitable insert statement cannot use a sequence.

來源:Oracle 9i documentation

相關問題