MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 query - Search on all fields

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Vimmy
Beginner


Joined: 03 Jan 2005
Posts: 1
Topics: 1

PostPosted: Wed Oct 05, 2005 5:25 pm    Post subject: DB2 query - Search on all fields Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Oct 06, 2005 4:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Oct 06, 2005 5:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group