I wonder if you issue might be that you are UPPER'ing the search parameter but not the field. So if the field holds "eric" and you search for "e" it isn't going to work because "eric" is not like "%E%". Below is your code formated differently, to each his own, but i find this much easier to read. I also added a call to $dbh->quote() so that users can't shove scary bad stuff into your query.

my %incoming = &read_input; # Read information into associated # array %incoming. my $mainsearch = $incoming{'yoursearch'}; # Fetch the text from the array. my $maintable = $incoming{'yourtable'}; # Fetch the text from the array. #Start DBI my $dbh = DBI->connect("dbi:xxxxxxxxxxx", "xxxxxxx", "xxxxxxxx"); #quote the search in case the user tries to hide something nasty in th +ere $mainsearch = $dbh->quote($mainsearch); my $st = $dbh->prepare(" select * from ( select * from qatest where UPPER(ser_app_name) like upper('%$mainsearch%') or UPPER(att_data) like upper('%$mainsearch%') or UPPER(mrserver) like upper('%$mainsearch%') or UPPER(owner_user) like upper('%$mainsearch%') or UPPER(lan_serv) like upper('%$mainsearch%') or UPPER(s_contact) like upper('%$mainsearch%') or UPPER(s_provider) like upper('%$mainsearch%') or UPPER(prod_deliv) like upper('%$mainsearch%') order by ser_app_name ASC ) where rownum < 31"); $st->execute();

___________
Eric Hodges

In reply to Re: Perl DBI / Variable Question by eric256
in thread Perl DBI / Variable Question by Trihedralguy

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.