Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to come up with a view/CA model
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01410693
Message ID:
01410704
Views:
33
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform