If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Search all columns in Informix table for a value

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-10, 16:11
bullyellis bullyellis is offline
Registered User
 
Join Date: Dec 2010
Posts: 3
Search all columns in Informix table for a value

I am new to Informix, but remember doing this with SQL Server. Basically I want to query all columns in a given table for a specified value (I am learning how a new program works and, as always, documentation is lacking).

Everything I googled references doing it in SQL server.

Also, what flavor of SQL does Informix use? For example, MS uses T-SQL, Oracle uses PL-SQL....

Reply With Quote
  #2 (permalink)  
Old 12-02-10, 09:05
bullyellis bullyellis is offline
Registered User
 
Join Date: Dec 2010
Posts: 3
Reply With Quote
  #3 (permalink)  
Old 12-15-10, 16:44
rpaskudniak rpaskudniak is offline
Registered User
 
Join Date: Feb 2009
Location: Brooklyn, NY
Posts: 5
Bullyellis or bulltorious,
That's quite a cool solution posted on stackoverflow. And thanks for introducing me (and us) to that site.

Just to add some spice to this question:
This question seems most likely to arise if you have violated the first rule of normalization: No repeated items (or groups of columns). Like providor_1, providor_2, .. providor_9. It is the reason for master-detail tables.

I recall an argument between the Informix instructor (Relational Database Design) and a developer at the NYC HRA, who was designing his database exactly like the above, building the maximum into the structure of the database rather than as a rule (trigger).
Reply With Quote
  #4 (permalink)  
Old 12-15-10, 16:53
bullyellis bullyellis is offline
Registered User
 
Join Date: Dec 2010
Posts: 3
Quote:
Originally Posted by rpaskudniak View Post
Bullyellis or bulltorious,
That's quite a cool solution posted on stackoverflow. And thanks for introducing me (and us) to that site.

Just to add some spice to this question:
This question seems most likely to arise if you have violated the first rule of normalization: No repeated items (or groups of columns). Like providor_1, providor_2, .. providor_9. It is the reason for master-detail tables.

I recall an argument between the Informix instructor (Relational Database Design) and a developer at the NYC HRA, who was designing his database exactly like the above, building the maximum into the structure of the database rather than as a rule (trigger).
It is also helpful when you are writing SQL in a new DB/program with no documentation. Make a change in the program and scan all the tables looking for that value. Make enough changes and you can eventually puzzle out how it the database works.

Yeah, it is an argument that I think has been cropping alot lately with NoSql type databases gaining popularity. The question really comes down to do you want your program driven by your database design or do you intend on having your program do all of the heavy lifting and using your database as a dumping ground for data.

I tend to lean more towards normalizing, especially with the advent of ORM tools.

stackoverflow is awesome. I get about 80% of my questions answered there. Protip: Ask your question around noon EST or PST when all of the programmers are cruising the internet.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On