Reorder Field Names?

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Jun 3 18:25:29 CDT 2003


on 6/3/03 17:39, Ken Ray at kray at sonsothunder.com wrote:

>>> Ruslan, my guess is that Ken wants more direct matching between the
>>> fields and the way he displays them (particularly when using * in
>>> SQL).
>> 
>> I also think so. But usually DBs do not allow this.
> 
> Thanks Ruslan, Robert. The main reason I was doing this is that I worked
> around an issue where I have two tables (Entities and Phones) and I want
> to retrieve the data so I can display fields of data from the Entities
> table and multiple phone numbers *side-by-side* in my display (which I
> posted to the list a while back). Effectively, retrieving multiple
> records from the Phones table and a single record from the Entities
> table, and then putting the two together. So for example, if I had 3
> phone numbers, I would get "my" Entity record and the 3 related Phone
> records and put them together so it looked something like this:
> 
> First, Last, Company, Phone1, PhoneLabel1, Phone2, PhoneLabel2,
> Phone3, PhoneLabel3
> 
> This couldn't work with a single SQL query (and postprocessing was too
> slow), so I "flattened" the Phones table so that there were fields for
> each possible phone number - where the original table had 4 fields
> (prefix, number, extension, type), the new table has 40 (so it can
> support 10 phone numbers) with a field order of

Ken,

As far as I see you have 2 entities here:
            Person ( First Last)
            Phone (Phone, Label)

This is not good design if you put phone numbers as single table.

It will be better to have ONE view in window for Person and second view
where will be displayed N related phones for that person.
This is standard way for 1 : M relation display.

In this way you will not limit self to 3 phones only.
You can store even 10 phones for some person if needed.
You see?    


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list