• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use the keyword for searching?

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I want to construct the SQL statement to find from every fields in the table in which they contain that keyword or not, how can I do it?

If I do select * from table where ...... like %keyword%,
can I create stupid query like this one ---->
select * form table where column1 like %keyword% or column2 like %keyword% ..... or column100000000 like %keyword%...... or not?

The good condition is I don't have the full-text search feature with my DB. T_T
 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know if there is a specific query to do the same. I have a couple of alternative notions.

If it is an existing table schema you can work with, Check if you have an audit table maintained for capturing the information about every field in a single field of the audit table.
If yes, try searching on those records and get the information. [Also check if maintains only the update audit. If yes, you might lose the information about inserts.]

If it is a new schema you are creating, try writing a trigger for the same.

Iam intersted in knowing the business case, working on which you had arrived at such a point.
[ August 05, 2007: Message edited by: Arun Kumarr ]
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check FREETEXTTABLE
 
reply
    Bookmark Topic Watch Topic
  • New Topic