Man;Server;Error;Instance;Instance_Detail;Status;CallNum
####
$call_num = &Check_For_Call($Man,$Server,$Error,$Instance_Detail);
####
my ($Man,$Server,$Error,$Instance_Detail) = @_;
$num = ();
$dbh = DBI->connect(qq{DBI:CSV:f_dir=$xcall_path}) or die &Debug_Log("\nDEBUG - Problems Connecting to CSV File\n");
$dbh->{'csv_tables'}->{'Exist'} = { 'file' => 'ExistCalls',
'sep_char' => ';',
'eol' => "\n"};
my($query) = "SELECT CallNum FROM Exist where Man like '$Man' and Server like '$Server' and Error like '$Error' and Instance_Detail like '$Instance_Detail'";
#&Debug_Log("SELECT CallNum FROM Exist where Man like '$Man' and Server like '$Server' and Error like '$Error' and Instance_Detail like '$Instance_Detail'\n");
my($sth) = $dbh->prepare($query) or &Debug_Log("\nDEBUG - Problems Preparing the SQL Statement in Check_for_Call\n");
$num = $sth->execute() or &Debug_Log("\nDEBUG - Problems Executing the SQL Statement in Check_for_Call\n");
if (defined $num) {
chomp($num);
$sth->finish();
$dbh->disconnect();
return ($num);
} else {
#No Call Number Defined
$sth->finish();
$dbh->disconnect();
return (2);
}
$sth->finish();
$dbh->disconnect();
return(1);
}