You seem to be trying to store the data in the same format as you will later
print it. This is usually not a good idea. As Mark pointed out in another
post, you would have no "holes" in the database by storing just the actual
data and showing the "holes" in the table (this is called a sparse table)
you will use to display the data.
Don't confuse the data storage with the data display. It is the table that
should be sparse, not the database.
I would wager you are most used to using a spreadsheet. ;-)
Using database you would have two tables:
o Item table contains item code and item name (and possibly: retail price,
wholesale price, vendor code, etc). This way you can add and remove items
easily.
1, soup
2, salad
...
5, water
o Sales table contains date, item code, and number of items sold (and
possibly: price, quantity, purchaser info like credit card number, etc.).
11/04/2002, 1, 5 (ie: 5 soups on Monday)
11/04/2002, 5, 2 (ie: 2 waters on Monday)
When you display this data in a table, Monday would have zeroes in every
item except soup and water.
-Paul
"J.P. Palm" <[EMAIL PROTECTED]> wrote in message
news:100347@;palm-dev-forum...
>
> Mark,
>
> thanks (if I had not already replied). My example is just that, an
example
> that I am applying to my real database structure.
>
> I don't think I have to worry too much about holes in my database as they
> should be very infrequent (almost immaterial) and I will be splitting my
> data over a few databases.
>
> My structure will probably resemble this:
>
> int key;
> bool var1;
> data var2;
> data var3;
> ...
> data var13;
>
> I may also have another int variable, but that is the jist of my layout.
>
> Thanks for offering your opinion/advice.
>
> Johnny
>
>
>
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus
>
>
> I am seeking advice on structuring my database when there may be several
> records that don't have valid data in all fields (columns), like a jagged
> array.
>
> For example, I am creating a table of items sold during the week:
>
> Item SU MO TU WE TH FR SA
> ---- -- -- -- -- -- -- --
> soup 5 2 3 0 0 0 0
> salad 6 2 5 4 2 0 0
> sndwch 2 2 3 5 2 2 2
> soda 3 3 8 8 1 1 0
> water 2 2 2 2 0 0 0
> ...
>
> What are some of the strategies I should consider in creating my
Database --
> Knowing that some items will always have ZEROS to close out the week.
(Soup
> and Water never offered on TH,FR,SA.)
>
> The table above may be upwards of 30 items. I may want to turn the
columns
> into Months of the year and thus have 12 columns (with the same
jagged-edge
> possibility - e.g. Salad not in season Nov-Dec).
>
> I'm trying to take into consideration the limited memory size of the
> handheld, that is why I am asking this question.
Any help?
Thanks in advance,
Johnny
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/