Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to simplify SQL statement
Message
 
 
À
28/08/2004 13:00:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00937299
Message ID:
00937317
Vues:
8
>I just tried to update my message to say that maybe your data is normalized...but you replied too fast :)
>
Unfortunately I type faster than I think <g>.

16 fields is an arbitrary limit set by the client. If they change it to 17, I will either jump in the lake, or will give them your name as a consultant to finish this project (just kidding). But, seriously though, it is a maximum number of equipment a conference room can have. And the limit is very reasonable so I don't think it will change.

But as I was thinking/reviewing your reply, I came up with the solution. After the cursor is created with my "short" SQL statement (for the report), I will add 16 new fields to the cursor:
EQ1SHOW, EQ2SHOW, etc. Then I will scan the cursor and populate the newly created fields EQ1SHOW, etc, from the actual fields EQ1NAME based on user selecting the equipment. Since the report will not have more than a couple of hundred records at most, I don't think the time will be a factor (the time necessary to scan the cursor second time). Does it make sense to you?


>The next question is why 16 fields? Is this just a guess of a maximum number there might be? What if business requirments change? As a child table, getting the data for the report becomes a simple join. For data entry screen purposes, you can still show it the same way as you currently are.
>
>>The data is normalized, although I understand why one might think it is not. But you make a good point about the field length hitting the limit of 254 char. So I have to rethink the strategy of displaying the fields. Thank you for your input and suggestions.
>>
>>>Hmmm...without knowing any details of the application, my first opinion is that these should not be in 16 fields, but in a separate table (related to the first), containing one record for each piece of equipment. Sounds like your data is not properly normalized.
>>>
>>>Another problem with your scheme is that it will crash when you hit 13 fields...255 (or 254?) character limitation per field...unless you are trimming the fields).
>>>
>>>How would you split this to rows once it got to the report?
>>>
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform