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:
01410707
Views:
22
>>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?

100+!!!! NO!!!!
BTW IN can have only 22 :-))


>
>
>>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.

Sure.

I know understand what you want(I think so)
Correct me if I'm wrong. You want to get ALL the selected models and IF some of them missing in That table to add them before the result is shown to user?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform