my $db_source = "dbi:Oracle(AutoCommit=>1):" .$proddbname; my $dbh = DBI->connect( $db_source, $proddbuser, $proddbpasswd ) or die "Keine Datenbankverbindung zu $db_source:\n$DBI::errstr"; foreach(@partnumbers) { $partnr = $_; chomp($partnr); $sth = $dbh->prepare('SELECT PRODUCT_ID FROM schema.products@dblink_to_testdb where (id=\'$partnr\')'); }