| 12
 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
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 
 | #!/usr/bin/perl -w
 
#perl
 
use DBI;
 
use POSIX qw(strftime);
 
use Net::FTP;
 
use Net::SMTP;
 
#use Win32::OLE;
 
 
 
# Lecture de la configuration
 
my $fic = uc($ARGV[0]);
#print "$fic \n\n";
 
sub check_fic
 
{
 
	# Connnexion aux BD
 
my $dbh_as = DBI->connect('dbi:ODBC:MINOS','USER','PASS');
 
 
 
   # REQUETE PERMETTANT DE RECUPERER LE FICHIER PRT02P10 DE LA BIBLIO FTPOUT
 
 
 
my $sth_as = $dbh_as->prepare(
 
q[SELECT].
 
q[ LOGEXPMIN.JOBEXPLOIT.APPLICATIF AS APP, LOGEXPMIN.JOBEXPLOIT.DATEMAJ AS DATE,].
 
q[ LOGEXPMIN.JOBEXPLOIT.ENREG AS NBLIGNE].
 
q[ FROM LOGEXPMIN.JOBEXPLOIT].
 
q[ WHERE].
 
q[ LOGEXPMIN.JOBEXPLOIT.APPLICATIF = '$fic' ]
 
);
 
$sth_as->execute;
 
my $appli;
 
my $nblignes;
 
my $date;
 
 
 
while (my $hash = $sth_as->fetchrow_hashref) {
 
	$appli = ${$hash}{'APP'};
 
	$appli =~ s/\s+$//;
 
	$nblignes = ${$hash}{'NBLIGNE'};
 
	$nblignes =~ s/\s+$//;	
 
	$date = ${$hash}{'DATE'};
 
	$date =~ s/\s+$//;	
 
}	
 
	print "$date$nblignes";
 
$dbh_as->disconnect();
 
}
 
check_fic(); | 
Partager