Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by clause changes and keeping sql dynamic
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Group by clause changes and keeping sql dynamic
Divers
Thread ID:
00798958
Message ID:
00798958
Vues:
60
Suppose I have

SELECT * FROM MYTABLE GROUP BY FIRSTFIELD, SECONDFIELD INTO TABLE MYTABLE2

Assume that firstfield and secondfield are the only fields in the table, so this query works in 8.0.

Now assume that someone adds a field to the table and this query now crashes because I don't have all of the fields in the group by clause.

Let's assume that we were dynamically building this table everytime "something" ran. If a field was added to "mytable" then this would not work anymore and it really stops being dynamic, because now if this happens, we need to change the code.

I suppose the proper way to handle this is to only select what you need so that way when you need something more than what you have already asked for you would need to go change the code anyway?

How do you keep things dynamic with this change and if you are selecting * in the query? I tried using mytable.* but I get errors that way.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform