The only occurance of execute in the script is

$sth->execute || die "Could not execute SQL statement ... " . $dbh->errstr;
I hope this is line 51.

This seems a bit odd to me, as you ought to be finding that error string in the log file. But the implication is clearly that $sth is undefined. The only way this can be happening is if the prepare on the previous line has failed. And you're not error trapping that.

(I no nothing about odbc, but the line if     ($where_clause) in the middle of the sql statement looks odd to me)

And I'm confused about the error trapping anyway: you've set RaiseError to 1, so every statement ought to be error trapped by DBI anyway. Which would explain why you don't see the "Could not execute SQL statement" in the log: DBI has died before your code gets a chance to. But it doesn't explain why the prepare doesn't result in death. Odd.

--
Tommy
Too stupid to live.
Too stubborn to die.


In reply to Re: Re: Re: Update on checkbox queries- revamped code and STILL getting blank screen..........Can anyone help? by tommyw
in thread Checkbox Query Revisited by Rachel

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.