I humbly submit the following conundrum for your consideration:

I am selecting several fields from a vanilla mysql database, however one row's result is being truncated. In particular, the 'torun' column contains <\ - this and anything following is truncated. For example, a database entry for torun contains:

touch /var/opt/OV/dbspi/defaults; /var/opt/OV/bin/instrumentation/dbsp +icfg -i </var/opt/OV/bin/instrumentation/disney-dbtab; /var/opt/OV/bi +n/instrumentation/dbspi_mw_int;
but the perl select:
$lookup = $dbh->prepare_cached("select file,whereto,filename,torun fro +m esm.ConfigMgr_FileRef"); $lookup->execute(); while ( ($Tfile,$Twhereto,$Tfilename,$Ttorun) = $lookup->fetchrow_arra +y) { print "$Twhereto\n"; print "$Tfilename\n"; print "$Ttorun\n"; }
returns only  touch /var/opt/OV/dbspi/defaults; /var/opt/OV/bin/instrumentation/dbspicfg -i

I validated that removing the < character allows the remaining text to be selected properly, but this is an important part of the data, which is used later in the program.

Despite searching perlmonks, nutshell books, and hitting my head against the keyboard, I have been unable to determine a fix. If any monk sees fit to share their knowledge, I would be eternally grateful.


In reply to DBI mysql select truncating on special character by bwern

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.