perl 调用 db2cmd 执行sql语句时出现错误: DB21061E 未初始化命令行环境。
跪求解决方案
代码:
my $rc = open(DB2CMD, "|db2 -mtvsp-");
# To see if bteq command invoke ok?
unless ($rc) {
print "Could not invoke BTEQ commandn";
return -1;
}
### Below are BTEQ scripts ###
print DB2CMD <
ENDOFINPUT
##db2 connect TO rwa USER DB2ADMIN USING DB2;
### End of BTEQ scripts ###
close(DB2CMD);