Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to come up with a view/CA model
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01410693
Message ID:
01410704
Vues:
32
>And that SELECT will give you these :-)
>If you(user) selects these - ModelIds 1,7,12,225 for OptionID = 1 AND MakeId = 12
>
>Then SELECTCmd will look like this:
>
>selOptionID = 1
>selMakeID   = 12
>STORE 0 TO m.lnModel1, m.lnModel2, m.lnModel3...m.lnModelN
>m.lnModel1 = 1
>m.lnModel2 = 7
>m.lnModel3 = 12
>m.lnModel4 = 225
>

So, you're suggesting 100+ parameters?


>SELECT *
>      FROM YourTable
>WHERE OptionID = ?m.selOptionID AND
>      MakeId   = ?m.selMakeID   AND
>      ModelId IN (?m.lnModel1, ?m.lnModel2, ?m.lnModel3...?m.lnModelN)
>
>
>Finaly this will be executed:
>
>SELECT *
>      FROM YourTable
>WHERE OptionID = 1  AND
>      MakeId   = 12 AND
>      ModelId IN (1, 7, 12, 225,0....,0)
>
>Which gave you a row for each ModelId, isn't it?

No, only if I already have records for such models in my table.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform