We defined our arrays by this
(my $sec0,my $min0,my $hour0,my $mday0,my $mon0,my $year0,my $ +wday0,my $yday0,my $isdst0) = localtime($theLocalTime+86400); (my $sec1,my $min1,my $hour1,my $mday1,my $mon1,my $year1,my $ +wday1,my $yday1,my $isdst1) = localtime($theLocalTime+172800); (my $sec2,my $min2,my $hour2,my $mday2,my $mon2,my $year2,my $ +wday2,my $yday2,my $isdst2) = localtime($theLocalTime+259200); (my $sec3,my $min3,my $hour3,my $mday3,my $mon3,my $year3,my $ +wday3,my $yday3,my $isdst3) = localtime($theLocalTime+345600); (my $sec4,my $min4,my $hour4,my $mday4,my $mon4,my $year4,my $ +wday4,my $yday4,my $isdst4) = localtime($theLocalTime+432000); (my $sec5,my $min5,my $hour5,my $mday5,my $mon5,my $year5,my $ +wday5,my $yday5,my $isdst5) = localtime($theLocalTime+518400); (my $sec6,my $min6,my $hour6,my $mday6,my $mon6,my $year6,my $ +wday6,my $yday6,my $isdst6) = localtime($theLocalTime+604800); @monArray = ($mon0,$mon1,$mon2,$mon3,$mon4,$mon5,$mon6); @mdayArray = ($mday0,$mday1,$mday2,$mday3,$mday4,$mday5,$mday6 +); @wdayArray = ($wday0,$wday1,$wday2,$wday3,$wday4,$wday5,$wday6 +);
The SQL statement code is this
$sql = "SELECT facility, department, name, soc, anniversary, years "." +FROM EMPFILE "."WHERE ((anniversary LIKE '".($monArray[0]."/".$mdayAr +ray[0])."') OR " ."(anniversary LIKE '".($monArray[1]."/".$mdayArray[1])."') OR + " ."(anniversary LIKE '".($monArray[2]."/".$mdayArray[2])."') OR + " ."(anniversary LIKE '".($monArray[3]."/".$mdayArray[3])."') OR + " ."(anniversary LIKE '".($monArray[4]."/".$mdayArray[4])."') OR + " ."(anniversary LIKE '".($monArray[5]."/".$mdayArray[5])."') OR + " ."(anniversary LIKE '".($monArray[6]."/".$mdayArray[6])."')) " ."ORDER BY facility, years DESC";
The error is thrown when I do the prepare statement
eval{$sqlH = $dbh->prepare($sql);};

In reply to Re^2: SQL ERROR by Anonymous Monk
in thread SQL ERROR by WebDev

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.