Well, this doesn't exactly answer your question...

Why are you searching 90+ columns anyway?

Is this a large table?  Will the query be run often?

If the answer to both of the above is yes, be prepared
to have a lengthy discussion with your DBA.

Jared ( a DBA )

On Tuesday 05 November 2002 05:56, Brad Smith wrote:
> I want to run a query that will perform a phrase search on all fields in
> the table.  I thought that it seemed really logical to write the statement
> like:
>
> my $dbh = DBI->connect('dbi:ODBC:database_name') || die DBI::errstr;
> my $sth = $dbh->prepare("SELECT *
>                          FROM table_name
>                          WHERE * LIKE '%$in{'search term'}%'
>                          ORDER BY name
>                         ");
> $sth->execute();
> while (($sid, $name)=$sth->fetchrow_array){
>       print qq~
> ....truncated...
>     ~;
>     }
> $dbh->disconnect();
>
>
> But I am wrong.... miserably, terribly wrong.  Perhaps this is off topic,
> since it relates more to SQL than DBI, specifically, so please send any
> replies directly to [EMAIL PROTECTED]  How would one run a
> phrase search across all the fields in a table?  I am prepared for having
> to type 96 OR's if I have to do so, but I am regretting it nonetheless. ;)
>
> Thanks in advance.
>
> Brad Smith

Reply via email to