我试图通过NAMES
从DB2中的Cursor C1
表中获取记录,并使用Perl脚本将其加载到另一个表Current Date
:
db2 "DECLARE C1 CURSOR FOR SELECT F.ID, F.NM from NAMES ;
db2 "load from C1 OF CURSOR method N(ID, CURRENT DATE) insert into STAGE(ID, INS_DT) nonrecoverable" > $LoadC1Results
我尝试过使用
my $date = localtime->strftime('%Y-%m-%d');
(或)
DateTime->now->strftime('%Y-%m-%d')
但仍然无法加载。收到SQL1191N , '14-12-05' not correct
等错误。
答案 0 :(得分:0)
你可以试试这个:
db2 "declare c1 cursor for select id, current date from names"
db2 "load from c1 of cursor insert into stage(id, ins_dt)"