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:
01410697
Views:
62
This message has been marked as a message which has helped to the initial question of the thread.
>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?

*** 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
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 :-)
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