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