如何使用基本 DML 操作在 db2 中创建外部 table
How to create external table in db2 with basic DML operation
我使用以下命令创建了外部 table
db2 "
CREATE EXTERNAL TABLE TEST(a int) using
(dataobject '/home/db2inst2/test.tbl' )
)
"
db2 "insert into TEST values(1)"
db2 "insert into TEST values(2)"
但看起来它正在取代价值。是否有任何选项可以附加文件并在外部 table 上执行基本的 DML 操作。如果 db2 V11.5
中还有其他选项可用,请告诉我
这不可能。
CREATE EXTERNAL TABLE statement
Restrictions
- External tables cannot be used by a Db2 instance running on a Windows system.
- Data being loaded must be properly formatted.
- You cannot delete, truncate, or update an external table.
- For remote external tables (that is, for external tables are not located in a Swift or S3 object store and for which the REMOTESOURCE option is set to a value other than LOCAL):
- A single query or subquery cannot select from more than one external table at a time, and cannot reference the same external table
more than once. If necessary, combine data from several external
tables into a single table and use that table in the query.
- A union operation cannot involve more than one external table.
另外:
For an unload operation, the following conditions apply:
- If the file exists, it is overwritten.
我使用以下命令创建了外部 table
db2 "
CREATE EXTERNAL TABLE TEST(a int) using
(dataobject '/home/db2inst2/test.tbl' )
)
"
db2 "insert into TEST values(1)"
db2 "insert into TEST values(2)"
但看起来它正在取代价值。是否有任何选项可以附加文件并在外部 table 上执行基本的 DML 操作。如果 db2 V11.5
中还有其他选项可用,请告诉我这不可能。
CREATE EXTERNAL TABLE statement
Restrictions
- External tables cannot be used by a Db2 instance running on a Windows system.
- Data being loaded must be properly formatted.
- You cannot delete, truncate, or update an external table.
- For remote external tables (that is, for external tables are not located in a Swift or S3 object store and for which the REMOTESOURCE option is set to a value other than LOCAL):
- A single query or subquery cannot select from more than one external table at a time, and cannot reference the same external table more than once. If necessary, combine data from several external tables into a single table and use that table in the query.
- A union operation cannot involve more than one external table.
另外:
For an unload operation, the following conditions apply:
- If the file exists, it is overwritten.