Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 4th, 2010, 05:28 PM
wakerunner wakerunner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 68 wakerunner User rank is Private First Class (20 - 50 Reputation Level)wakerunner User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 12 h 49 m
Reputation Power: 5
Like '%ANYTHING%' with all fields in table

I think I know the answer to this already but thought I'd make sure. Is it possible to do a SQL query with a "Like" match on all fields in the table without listing each table?

So instead of:

where lastname like '%DOE%' or firstname like '%DOE%' or address like '%DOE%'

You could do something like

"any fields" like '%DOE%'

Reply With Quote
  #2  
Old October 7th, 2010, 06:38 AM
mariuz's Avatar
mariuz mariuz is offline
Bug Hunter
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Transylvania (Romania)
Posts: 309 mariuz User rank is Sergeant (500 - 2000 Reputation Level)mariuz User rank is Sergeant (500 - 2000 Reputation Level)mariuz User rank is Sergeant (500 - 2000 Reputation Level)mariuz User rank is Sergeant (500 - 2000 Reputation Level)mariuz User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 9 h 38 m 4 sec
Reputation Power: 22
Arrow

I don't think is implemented yet , or you can add it to features list if you want

I would like something like that that will search in all tables


Code:
Select foo, bar from db.* where [db.*] like '%foobar%'


maybe you can do it in a stored procedure

something like

1. read all table fields names
2. put them and execute an

Code:
select * from table where [selected_field_names] like '%foobar%'


the same with multiple tables
1.select all tables names
2. put them and execute and
Code:
select * from table where [selected_field_names] like '%foobar%'
__________________
My home page: http://www.firebirdsql.org and work place :http://www.reea.net

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Like '%ANYTHING%' with all fields in table

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap