【发布时间】:2018-03-26 13:55:47
【问题描述】:
我无法找到如何将数组 var1 的第 5 个值前值的 剔除。
my $sql2 = 'select name, value from A.Database2 minus select name, value from A.database1';
my $sth2 = $dbh1->prepare($sql2);
$sth2->execute();
while ( my @row = $sth2->fetchrow_array ) {
print join(',', @row), "\n\n";
chomp;
push( @var1, $row[0] );
}
foreach ( @var1 ) {
print "$_\n";
}
my $sth3 = $dbh->prepare("select name, value from A.database1 where name in (" . join(",", @var1) . ")" ) or die "Can't prepare statement: $DBI::errstr";
$sth3->execute(@var1);
while ( my @row = $sth3->fetchrow_array ) {
print join(", ", @row), "\n";
}
DBD::Oracle::db prepare failed: ORA-00904: "APR_IMDG_MODE_ENABLED": invalid identifier (DBD ERROR: error possible near indicator at char 144 in 'select name,value from A where name in (a ,b,c,d,e)') [for Statement "select name,value from A where name in (a,b,c,d,e)"] 在 hello.pl 第 102 行。
用户代码中未捕获的异常:
无法准备语句:ORA-00904:“APR_IMDG_MODE_ENABLED”:无效标识符(DBD 错误:错误可能在'select name,value from where name in (a,b,c,d,e)') 在 hello.pl 第 102 行。
【问题讨论】:
-
你不能使用子查询来代替两个单独的数据库调用吗?您需要
value列吗? -
@Borodin 我需要打印A表database1的name和values列数据
-
join(",", @var1)=>qw(?) x @var1