Complex Database Searching...........

Reply

Join Date: Sep 2007
Posts: 28
Reputation: nice_true is an unknown quantity at this point 
Solved Threads: 0
nice_true nice_true is offline Offline
Light Poster

Complex Database Searching...........

 
0
  #1
Oct 30th, 2007
Hi!

How can I seach all of the fields of every table in a databae for a
particular value? When it is found, I want to be able to display the table
name and the field name, then continue to search.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 20
Reputation: ferensick is an unknown quantity at this point 
Solved Threads: 4
ferensick ferensick is offline Offline
Newbie Poster

Re: Complex Database Searching...........

 
0
  #2
Aug 6th, 2009
Not enough info is given here... such as, db used, is this front-end, back-end, etc?
One way to do this is to simply use a SELECT statement.
  1. SELECT * FROM <table1> WHERE <field1> LIKE '%value%'
The best bet is to have the statements automatically generated, having the <tables> and <fields> as variables.
Last edited by peter_budo; Aug 6th, 2009 at 7:46 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 481
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training

Re: Complex Database Searching...........

 
0
  #3
Aug 7th, 2009
try this.
Attached Files
File Type: zip SEARCH.zip (38.4 KB, 5 views)
I like sword. Attack or Defense.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,124
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 129
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Complex Database Searching...........

 
0
  #4
Aug 11th, 2009
If the database is oracle you need to play with USER_TAB_COLS view. You need to frame queries dynamically at run time in a loop and execute.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 33
Reputation: padtes is an unknown quantity at this point 
Solved Threads: 7
padtes's Avatar
padtes padtes is offline Offline
Light Poster

Re: Complex Database Searching...........

 
0
  #5
Sep 11th, 2009
In dot net, once you connect to a database, you have lists of all tables and for each table, list of columns available. Select * from each of the table and loop through all columns for all records.

Sounds like simple looping but might be whole lot of work for the machine.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC