我有一个sql文件test.sql,
test.sql:
---------
drop table a.table1;
drop table a.table2;
drop table a.table3;
drop table a.table4;
drop table a.table5;现在,我想通过以下方式执行test.sql
db2 -tvf test.sql > result.log我想要实现的目标是为每条sql语句的输出附加一个日期时间,日期时间可以是任何格式,并且应该是执行相应sql语句时的日期时间,现在假设每个drop语句需要1秒执行,result.log应该是这样的:
result.log:
-----------
Wed Dec 6 18:46:41 HKT 2017 DB20000I The SQL Command Completed Successfully.
Wed Dec 6 18:46:42 HKT 2017 DB20000I The SQL Command Completed Successfully.
Wed Dec 6 18:46:43 HKT 2017 DB20000I The SQL Command Completed Successfully.
Wed Dec 6 18:46:44 HKT 2017 DB20000I The SQL Command Completed Successfully.
Wed Dec 6 18:46:45 HKT 2017 DB20000I The SQL Command Completed Successfully.你知道如何实现它吗?提前谢谢。
https://stackoverflow.com/questions/47687253
复制相似问题