# ########################################################### # Connect to the DB # ########################################################### # $msg = "\n\tDBI - Failed to connect to $db_name" ; $dbh = DBI->connect( "dbi:Oracle:$db_name", "$username", "$password", \%attr) or &end_it($mail_msg,$file_open,$to,$domain,$from,$subject,$msg,$null,$logfile) ; # ########################################################### # Update logfile # ########################################################### # $msg = "\n\tDBI - User $username connected to $db_name." ; print LOG "$msg" or &end_it($mail_msg,$file_open,$to,$domain,$from,$subject,$msg,$text,$logfile) ; # ########################################################### # Prepare SQL # ########################################################### # $msg = "\n\tDBI - Preparing SQL." ; print LOG "$msg" or &end_it($mail_msg,$file_open,$to,$domain,$from,$subject,$msg,$text,$logfile) ; $sth = $dbh->prepare( "\@OBFX001S") or &end_it($mail_msg,$file_open,$to,$domain,$from,$subject,$msg,$null,$logfile) ; # $msg = "\n\tDBI - prepared SQL." ; print LOG "$msg" or &end_it($mail_msg,$file_open,$to,$domain,$from,$subject,$msg,$text,$logfile) ; # ########################################################### # Execute the prepared SQL # ########################################################### # $msg = "\n\tDBI - Failed to execute SQL (OBFX001S)." ; $sth->execute() or &end_it($mail_msg,$file_open,$to,$domain,$from,$subject,$msg,$null,$logfile) ; $msg = "\n\tDBI - SQL (\@OBFX001S) executed." ; print LOG "$msg" or &end_it($mail_msg,$file_open,$to,$domain,$from,$subject,$msg,$text,$logfile) ; # ########################################################### # Disconnect from the DB # ########################################################### # $msg = "\n\tDBI - Failed to disconnect from $db_name." ; $dbh->disconnect() or &end_it($mail_msg,$file_open,$to,$domain,$from,$subject,$msg,$null,$logfile) ; # ########################################################### #