how to copy values from a file into a oracle-table using DBI
hi everybody,
i want to fill in a oracle-table infos witch i get from a file.
my problem is, the database is a remote database, so is it possible to send the
file infos to the database and fill it into a table?
i have tried it, but it doesnt work.
here you can see my test_script and the error message:
#!/usr/local/bin/perl -w
use DBI;
use DBD::Oracle;
use strict;
my $dbh = DBI->connect('DBI:Oracle:host=dbtest2;sid=mptest1','user','passwd',
{ RaiseError => 1, AutoCommit => 1}
);
my $sth = $dbh->prepare( "INSERT INTO table(serxers) ");
open (FH,"<servers>") or die "unable to open file: $!";
while (<FH>) {
chomp;
my ($serxers) = split / /;
$sth->execute( $serxers);
Quote:
}
close FH;
#$dbh->commit;
$dbh->disconnect;
error-message:
awimmer.NOSID.mpsun01> fill_in.pl
unable to open file: No such file or directory at ./fill_in.pl line 16.
(but the source-file exsists in the directory !!)
thanx
andi