View previous topic :: View next topic |
Author |
Message |
Vimmy Beginner
Joined: 03 Jan 2005 Posts: 1 Topics: 1
|
Posted: Wed Oct 05, 2005 5:25 pm Post subject: DB2 query - Search on all fields |
|
|
Hi,
I am not sure if this is a valid question...
Is it possible to search for a keyword in a DB2 table without knowing in which the DB2 field the keyword will be present ??
Basically , is it possible to search on all fields in a DB2 table ???
Thanks, |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Oct 06, 2005 4:33 am Post subject: |
|
|
Vimmy,
Couple of options.
1. Code all the columns in the WHERE clause.
ex:
Code: |
SELECT *
FROM TABLE
WHERE COL_1 LIKE '%SEARCH STRING%'
OR COL_2 LIKE '%SEARCH STRING%'
...
|
2. Unload the table and use sort/file-aid to select the desired records.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Thu Oct 06, 2005 5:09 am Post subject: |
|
|
Kolusu,
Quote: |
2. Unload the table and use sort/file-aid to select the desired records.
|
Good Thinking....You are really great in providing alternate solutions when the answer is 'NO'/'NOT POSSIBLE'. Excellent.
Thanks,
Phantom |
|
Back to top |
|
|
|
|