I am getting this error with this code:

[Fri May 18 19:40:00 2001] asdma.pl: DBD::CSV::Statement=HASH(0x8286b18) is not a valid SQL::Statement object at /usr/lib/perl5/DBD/File.pm line 171.

Also I know the '%$query%' in not a proper statment... any ideas?

my $query; foreach $query (@astype) { print $query; my $sql = "select title from $TABLE2 where astype like '%$query'"; my $sth = $dbh->prepare($sql) or die "Cannot Prepare: " . $dbh->errstr(); $sth->execute() or die "Cannot execute: " . $sth->errstr(); while (@row = $sth->fetchrow_array()) { $adlocation = ( join (",", @row)); } print $adlocation;

Edited 2001-05-19 by mirod: added <code> tags


In reply to DBI and like statment by sixcolors

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.