Let me see if I can make this a bit more clear. After your comments I can see how you might have been confused. Now, after 5 hours of meetings, this might get more confusing but lets hope not.

By adding a field to the table that you want to store your generic "name" and "value" fields into - you increase it's ability to accept values for different reasons exponentially (or is it geometrically?). My suggestion is to add another field - call it "type". This new field would contain a value that you could use to group all your variables together with. Kinda like tieing a bunch of sticks together so that when you grab the bunch your get them all - same idea with the data fetching routine - grab them by "type" not by variable name. If you do this you limit the Disk I/O and optimize the use of buffering available for which ever data base engine you are using.

This new field now groups all your variables - you fetch them (using your WHERE clause by including the new "type" field). Once you have all your vairables - you can allow the user to alter them in any fashion you wish. Or for that matter, the program can alter them in any fashion it wishes.

Ok - with that understanding - now you can extend any database table without having to specifically add new fields to existing tables - you simply add data to an already existing table - this new data allows you to group, identify and quantify the new field data. So - for instance - there is an already existing table named MonthlyStats - you need a field for MeanSales - you simple add a record in the the "other" table (the one you added "type" to) type = MonthlyStats, name - MeanSales, value=1,200,000.00.

If you add some "smart comments" into your code where you place these "hooks" - you can then later search and replace this code with code that looks at the parent table (the one you extended) - this of course assumes that the "quick fix" you did to avoid having to bring the database server down for maintenance to add a field earlier has at some point been done. Oh yeah - you would have to create a data migration utility to take the data from one table to the parent.

If this is still confusing (as I'm sure it is) - just drop me a note and I will forward you my phone number. Maybe I can explain this better in that context.


In reply to Re: Re: Re: Another Opinion Request...(config file) by draconis
in thread Another Opinion Request...(config file) by powerhouse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.