but while running I am getting this error#!/usr/bin/perl #use strict; use DBI; use MIME::Lite; # Code to get the system name and and there by ToEmail my $cSystemName = `uname -n`; chomp($cSystemName); #Removing the \n, if it's there. my $cToEmail = "denzil\@gmail.com"; # Database Connection Code my $cHostname = "dbi:Oracle:dev1"; my $cDbusername = ""; my $cDbPassword = ""; my $dbh = DBI->connect($cHostname,$cDbusername,$cDbPassword, {RaiseError =>1,AutoCommit => 0,PrintError =>0}) or die ("Can't connect to Oralce database : $DBI::e +rrstr"); #End of database connection code.. # Code to get the the timezone in the database my $query = "SELECT timezone FROM compctl"; my $result = $dbh->prepare($query); $result->execute() or die ("Can't execute the following query :\n $ +query\n"); my $cTzone = ""; $result->bind_columns(undef,\$cTzone); $result->fetch(); $result->finish(); # End of code to get the timezone # my $query1 = "SELECT substr(mvp_notes.cref,5,16), mvp_notes.ctext, mvp_notes.ctext_ext, substr(mvp_notes.cinputuser,5,10), to_char(mvp_notes.tinputdate,'DD-MON-YYYY HH24:MI:SS'), mvp_note_types.ctype FROM mvp_notes,mvp_note_types WHERE mvp_notes.mvp_note_types_id = mvp_note_types.id AND mvp_note_types.ccode = 'ACUPD'"; #AND mvp_notes.tinputdate > sysdate - 2"; my $sth = $dbh->prepare($query1); use Data::Dumper; print Dumper([$sth]); $sth->execute() or die ("Can't execute the following query :\n $quer +y1\n"); my ($cRef, $cText,$cTextext,$cInputuser,$tInputdate,$cType); $sth->bind_columns(undef,\$cRef, \$cText,\$cTextext,\$cInputuser,\$tI +nputdate,\$cType); $cMessage = ""; while( $sth->fetch()) { $cText =~ s/\|/\n/g; # Replacing | with \n $cTextext =~ s/\|/\n/g; # Replacing | with \n $cMessage .= "$cType for $cRef by $cInputuser on $tInputdate $cT +zone"; $cMessage .= "\n\n"; $cMessage .= $cText; $cMessage .= "\n"; $cMessage .= $cTextext; $cMessage .= "\n"; } $sth->finish(); # Email sending using MIME::Lite pakcage. my $cSubject = "Daily changes to customer code"; my $cMimeType = "text/plain"; my $cFromEmail = "$cToEmail"; # print $cToEmail; my $mail = MIME::Lite->new( From => $cFromEmail, To => $cToEmail, Subject => $cSubject, Type => $cMimeType, Data => $cMessage ); $mail->send or die ("Can't send the mail."); print "\n Executed successfully\n"; $dbh->disconnect();
Please help me to fix this errorDBD::Oracle::st fetch warning: (err=0, errstr=undef, state=undef) [for + Statement "SELECT substr(mvp_notes.cref,5,16), mvp_notes.ctext, NVL(mvp_notes.ctext_ext,''), substr(mvp_notes.cinputuser +,5,10), to_char(mvp_notes.tinputdate,'DD-MON-YYYY HH24:MI:SS'), mvp_note_types.ctype FROM mvp_notes,mvp_note_types WHERE mvp_notes.mvp_note_types_id = mvp_note_types.id AND mvp_note_types.ccode = 'ACUPD'"] at display.pl line +75. Executed successfully
In reply to DBD::Oracle::st fetch warning by denzil_cactus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |