Hello Monks, first you helped my much with my insert/update problem in mysql. Now I have a little question for the select command. I'm doing a select in my module by this command:
if ($what eq "W") { $sth = $dbh->prepare( sprintf "select * from %s where +%s = %s",$dbh->quote_identifier($table),$dbh->quote_identifier($col), +$sel); .....and so on } }
My csv list is looking like this:
XZ14B:TEST:TEST:TEST:TEST XX145:TEST:TEST:TEST:TEST 11111:TEST:TEST:TEST:TEST
The first column is my primary key (customer article number). I only get the lines back when I'm looking for the article number with only number in it. In this example I get 11111:TEST:TEST:TEST:TEST. The others cause an error Unknown column 'XZ14B' in where clause. But I don't give the article numbers to the column scalar. In the column scalar is really the column name (in this case tab1). Did I make a mistake at the columns values. First column is CHAR(30) or VARCHAR(30) right ? Crosspost: http://forums.mysql.com/read.php?10,558320,558320#msg-558320

In reply to Mysql Select Query by Perl by endymion

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.