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:
01410698
Vues:
41
>>Hi everybody,
>>
>>I have a junction table that is supposed to have
>>
>>OptionID MakeID ModelID and some price fields.
>>
>>I have one OptionID and one MakeID selected and I can have multiple ModelID selected.
>>
>>I want to have a view (or CA) which would have records for each of them, e.g.
>>
>>selOptionID selMakeID selModelID1         Price fields
>>selOptionID selMakeID selModelID2         Price fields
>>
>>
>>If I already have a record in my table, I want to retrieve it, otherwise prepare a record to fill.
>>
>>Also I want to be able to cancel at any moment and therefore new records would not be added.
>>
>>I'm not sure how to construct such view or CA.
>>
>>Any ideas?
>>
>>Thanks in advance.
>
>
>*** SelectCmd
>
>SELECT * (or field list)
>      FROM YourTable
>WHERE OptionID = ?m.selOptionID AND
>      MakeId   = ?m.selMakeID   AND
>      ModelId IN (?m.lnModel1, ?m.lnModel2, ?m.lnModel3...?m.lnModelN) && what is the biggest number of models?
>
Here I don't know how many models I select. How can I make this dynamic?

I haven't checked the max number, but may be ~100 Models at most.
>*** AfterCursorFill and AfterCursorRefresh() events
>IF lResult
>   this.CheckForRecors()
>ENDIF
>
>***  CheckForRecors method of the CA
>IF RECCOUNT(this.Alias) == 0
>   APPEND BLANK IN (this.Alias)
>ENDIF
>
We need a record for each passed ModelID, not just one.


>Of course it should be table buffered and you always can have TABLEREVERT() when you don't want to store record.
>That is VERY rough example, but you know what I mean :-)

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