$ db2 "create table testtab1 (cola int, colb int, colc timestamp not null default)"
DB20000I The SQL command completed successfully.
$ cat tt1.del
1,1,1
2,2,2
3,3,99
$ db2 "load from tt1.del of del method P(1,2) insert into testtab1 (cola, colb)"
SQL27967W The COPY NO recoverability parameter of the Load has been converted
to NONRECOVERABLE within the HADR environment.
SQL3109N The utility is beginning to load data from file
"/home/db2inst1/tt1.del".
SQL3500W The utility is beginning the "LOAD" phase at time "07/12/2021
10:14:04.362385".
SQL3112W There are fewer input file columns specified than database columns.
SQL3519W Begin Load Consistency Point. Input record count = "0".
SQL3520W Load Consistency Point was successful.
SQL3110N The utility has completed processing. "3" rows were read from the
input file.
SQL3519W Begin Load Consistency Point. Input record count = "3".
SQL3520W Load Consistency Point was successful.
SQL3515W The utility has finished the "LOAD" phase at time "07/12/2021
10:14:04.496670".
Number of rows read = 3
Number of rows skipped = 0
Number of rows loaded = 3
Number of rows rejected = 0
Number of rows deleted = 0
Number of rows committed = 3
$ db2 "select * from testtab1"
COLA COLB COLC
----------- ----------- --------------------------
1 1 2021-12-07-10.14.04.244232
2 2 2021-12-07-10.14.04.244232
3 3 2021-12-07-10.14.04.244232
3 record(s) selected.
2条答案
按热度按时间xdyibdwo1#
请尝试:
自V7.x以来,只要Db2-LUW得到全面服务(即,正确应用了最终的修复包),就可以在Db2-LUW中使用此修改符
usedefaults
。请注意,某些Db2-LUW版本对
usedefaults
修饰符的使用有限制,如文档中所述。例如,与其他修饰符、模式或目标表类型一起使用的限制。在请求帮助时,请始终指定您的Db2服务器版本和平台,因为答案可能取决于这些事实。
huwehgph2#
您可以使用METHOD P指定输入文件中的哪些列进入表中的哪些列-如果您省略了需要使用默认值的列,则会引发警告,但会填充默认值: