Hi Monks I am trying to run this script
#!/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();
but while running I am getting this error
DBD::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
Please help me to fix this error

In reply to DBD::Oracle::st fetch warning by denzil_cactus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.