1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!D:\perl\bin\perl.exe
use DBI;
$dbname="base";
$dbuser="user";
$dbpass="pass";
my $dbh = DBI->connect("dbi:Oracle:$dbname", $dbuser, $dbpass, {AutoCommit => 0})
|| die "Unale to connect to $dbname: $DBI::errstr\n";
open(FILEIN,'<c:\\abaque.txt');
print ("entrez une date au format yyy-mm-jj : \n");
$DATE = <STDIN>;
$query="MA REQUETE";
$sth = $dbh->prepare($query);
$sth->execute();
while( @ligne = $sth->fetchrow_array() ) {
print "@ligne\n";
print FILEIN "@ligne\n";
}
$sth->finish();
$dbh->disconnect || warn $dbh->errstr;
close FILEIN || die "Problème à la fermeture : $!"; |