More of an SQL question but it involves DBI. Specifically my question has to do with the * field identifier and the use of.

I'm attempting to construct a query to pass to DBI/AnyData/SQL:Statement to run on a database that contains all the content of my website. The db has roughly 15 or so fields in which all the document data is stored (author, creation date, abstract, etc). I'm trying to query all the fields in the database so that if, say, someone wanted to see all the documents that had the word 'sean' in *one or more* of the fields, they could search for it. I've tried:

  ...WHERE * CLIKE '%sean%'...

But that doesn't work; no results (bad syntax or incorrect logic?). The only way I've found so far that will allow me to get the results I want is to specifically go thru and list each field with a OR separator like:

   ...WHERE Title CLIKE '%sean%' OR Author CLIKE '%sean%' OR Created CLIKE...

Doesn't SQL:Statement support the * field identifier or am I setting this up wrong??? I rather not have to pass any field names if possible. Granted, I could query the data source for the column headers but this just seems like the long way of getting it to work. Also it makes the final SQL string huge which looks ugly when displayed to the user (if I opt to).

TIA

======================
Sean Shrum
http://www.shrum.net


In reply to DBI - Multi-field SQL: *OR* condition w/o specifying field names...possible? by S_Shrum

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.