谁能告诉我 SQL Loader 中的 Insert 和 Append 语句之间的区别吗?请考虑以下示例: 这是我的控制文件
load_1.ctl
load data
infile 'load_1.dat' "str '\r\n'"
insert*/+append/* into table sql_loader_1
(
load_time sysdate,
field_2 position( 1:10),
field_1 position(11:20)
)
这是我的数据文件
load_1.dat
0123456789abcdefghij
**********##########
foo bar
here comes a very long line
and the next is
short
最佳答案
documentation相当清楚;使用INSERT
当您加载到空表中时,并且 APPEND
当向(可能)包含(您想要保留的)数据的表添加行时。
APPEND
如果你的 table 是空的,仍然可以工作。 INSERT
如果您期望表为空,可能会更安全,因为如果不是这样,它会出错,可能会避免意外结果(特别是如果您没有注意到并且没有收到其他错误,例如唯一索引约束违规)和/或加载后数据清理。
关于oracle - SQL Loader 中的 Insert 和 Append 语句之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4812908/