The log file for this contains the "DBI - prepared SQL." entry and the script terminates with the "DBI - Failed to execute SQL (OBFX001S)." message. This message is also correctly present in Email the script sends. Can "command files" be executed from DBI? Thanks in anticipation, Ronnie Cruickshank# ########################################################### # 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,$su +bject,$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,$nul +l,$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,$nu +ll,$logfile) ; # ########################################################### #
Edit: Added <code> tags. larsen
In reply to DBI & Oracle Command Files by Ronnie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |