Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2010
    Posts
    3

    Unanswered: 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....


  2. #2
    Join Date
    Dec 2010
    Posts
    3

  3. #3
    Join Date
    Feb 2009
    Location
    Brooklyn, NY
    Posts
    9
    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).

  4. #4
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •