473,699 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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
6 2145
Meetee
931 Recognized Expert Moderator Contributor
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
SaSystem1989
2 New Member
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 Recognized Expert Moderator Contributor
Look up for information_sch ema which stores metadata information of database.
Oct 22 '12 #4
Rabbit
12,516 Recognized Expert Moderator MVP
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
coding master
11 New Member
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,569 Recognized Expert Moderator MVP
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
2700
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 database MUST be encrypted and be displayed on-screen in a format that cannot be 'Copy/Pasted'. Apart from the search results displayed on-screen, user must NOT be able to extract multiple records to use for Spamming. Database about 1/2 million...
10
39351
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: domything() And the regexp search assuming no case restriction would be,
3
2280
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 database. So, something like SELECT "column_name" FROM "table_name" ?SQLcommand? (parm1 and parm2 and "phrase phrase2")
16
2509
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 people, no more than 10 concurrent users at any one time) all of which had Access 97 loaded on their machines. Everything was going smoothly, and I delivered them their VBA application that does everything they initially wanted it to. However,...
5
2232
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 OleDbConnection1.State = ConnectionState.Closed Then OleDbConnection1.Open() Else
5
2690
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 SQL data and the contents of any referenced files. The returned list being a listing which includes both records containing the text and files containing the text. Does anyone have a simple example of programatically searching for files
4
2351
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 database field for a match then display on a web page. So I have a webpage called "PartsSearch.asp". This has a text box that when entered calls "PartsSearchResults.asp" with the following script:-
1
1627
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 my ASP page and search for user records, I have it displaying them all at the moment, and because ive just started it im using 3 Bogus I.D's,
2
1387
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 customers to find data that meets certain requirements (a customer that has had two or more transactions with us, all being under $2,500 but totaling over $3,500). I have mainly worked with Java and SQL and know how I would search for these requirements...
0
8630
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9199
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9055
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7786
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6550
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4638
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3075
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2364
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.