Hi, I'm executing a script that is giving the error above. It's falling over on executing this bit of script:
use Win32::ODBC; use CGI qw(:standard); use CGI::Carp qw/fatalsToBrowser/; sub NoFeedback {for (1 or 0) if (!($db=new Win32::ODBC($DSN))) { print "Error connecting to Database\n"; print "Error: " . Win32::ODBC::Error() . "\n"; } #end if (!($db=new Win32::ODBC($DSN))) $SqlStatement = $sql; print "SqlStatement = $SqlStatement"; if ($db->Sql($SqlStatement)) { print "SQL failed.\n"; print "Error: " . $db->Error() . "\n"; if ($DebugMode) { print "<HR>$SqlStatement<HR>"; } #end if ($DebugMode) } # end if ($db->Sql($SqlStatement)) else { while($db->FetchRow()) { $Email = $db->Data(); $MAilOut = $MAilOut.$Email."\n"; print "Emailing: $Email\n<BR>"; $db->Close(); }#END sub NoFeedback
The $Sql is
SELECT DISTINCT Feedback.Email FROM Feedback LEFT OUTER JOIN FOSBriefe +r ON Feedback.Username = FOSBriefer.Username WHERE (ISNULL(FOSBriefer +.Username, 'z') = 'z')
This bit of SQL executes fine in Query Analyzer but returns this error when executed as part of the script:
SQL failed. Error: [911] [1] [0] "[Microsoft][ODBC Driver Manager] Inv +alid string or buffer length"
Is the SQL Statement simply too long or is it something else obvious?

In reply to Win32::ODBC ibvalid string or buffer length by kjg

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.