my $odbh = DBI->connect("dbi:Oracle:stuff","xxx","x", { RaiseError => 1, PrintError => 1, ChopBlanks => 0 }); my $mdbh = DBI->connect("dbi:mysql:kultur","xxx","x", { RaiseError => 1, PrintError => 1 }); $odbh->{ChopBlanks} = 0; my $msth = $mdbh->prepare("SELECT * FROM atable limit 1"); my $osth = $odbh->prepare("INSERT INTO atable (".(join",",@atablelist).") VALUES (".(join ",",map {"?"} @atablelist).")"); $msth->execute() || die $mdbh->errstr; while (my $db=$msth->fetchrow_hashref) { $osth->execute(map {defined $$db{$_} && $$db{$_} eq '' ? " " : $$db{$_}} @atablelist) || die $odbh->errstr; }