473,405 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How I can search data in database? search data including text, number and datetime

hi all, is it possible to Search data in database? with a single sql script or some tools will help me?
for example ,I have a HR database ,and I want to search 'CEO', $2354.00 or '12/4/1996' in all of the records.
Oct 22 '12 #1

✓ answered by Rabbit

If you're looking for that value anywhere in any table in any row in any field in the database, you will have to return all the information schema data as meetee suggests. And then you will have to loop through it creating dynamic sql to do the actual search.

Just so you are aware, this is take tremendous amounts of time unless your database is small.

6 2137
Meetee
931 Expert Mod 512MB
Use where condition. For eg.
Expand|Select|Wrap|Line Numbers
  1. select * from HR_Master where position = 'CEO' and salary = 2354 and date = 'YYYY-MM-DD'
Oct 22 '12 #2
what i mean is

search all columns of all tables ,search 2345 in the database ,returns table's names and column's names
for example:

owner tablename columnname
-------------------------------
HR salary monthly
HR salaryhis yearly
......
Oct 22 '12 #3
Meetee
931 Expert Mod 512MB
Look up for information_schema which stores metadata information of database.
Oct 22 '12 #4
Rabbit
12,516 Expert Mod 8TB
If you're looking for that value anywhere in any table in any row in any field in the database, you will have to return all the information schema data as meetee suggests. And then you will have to loop through it creating dynamic sql to do the actual search.

Just so you are aware, this is take tremendous amounts of time unless your database is small.
Oct 22 '12 #5
use this conditon
Expand|Select|Wrap|Line Numbers
  1. Select * from HR_Table_Name where Designation='CEO' AND Salary='2354RS'AND date='MM-DD-YYYY'
Nov 29 '12 #6
NeoPa
32,556 Expert Mod 16PB
I'm afraid that wouldn't work for reasons already discussed in the thread (and others which haven't been - like it wouldn't match any records anyway).
Nov 29 '12 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: BillK | last post by:
Hi - I am looking for a solution to a clients requirement. They want to distribute a database of info on CD, which user can search on selected fields and results will be displayed. The data and...
10
by: Anand Pillai | last post by:
To search a word in a group of words, say a paragraph or a web page, would a string search or a regexp search be faster? The string search would of course be, if str.find(substr) != -1:...
3
by: Bill | last post by:
I can't believe I can't find this answer on Google... I'm trying to build a database search query. User enters a search term into a box, and so I'd like to use that string to search a column in a...
16
by: Andy_Khosravi | last post by:
I'm in a bit of a pickle. My employer, a health insurance firm, had me design a small database to track benefit issues. The intended users were technical specialists and some managers (about 90...
5
by: aniket_sp | last post by:
i am using a data adapter and a dataset for filling and retrieving data into .mdb database. following is the code..... for the form load event Dim dc(0) As DataColumn Try If...
5
by: Mark | last post by:
Hi I have an application (in vb.NET 2005) which holds data in SQL Server and some of the SQL records are simply paths to related files. I would like to be able to do a text search on both the...
4
by: willers | last post by:
Hi All, I have created a web site using Frontpage2003 that I have also used to create an Access database to store info on. I am now trying to add a 'Search' facilty where it will search a...
1
by: pontypete | last post by:
Hi all Ive managed to create an ASP & ACCESS local site/databse, Now the aim: Membership Number = 1 Fname = Peter ^ everything in the databse, I want to beable to have a search box within...
2
by: rich s smith | last post by:
I'm proposing an idea for the company that I'm interning with. They use Access and I have used it before. I was trying to decide what the best method would be to search the database for certain...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.