Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
3 Views or one?
Message
From
12/03/1998 13:07:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00084167
Message ID:
00084210
Views:
24
>I need an updatable view in my application, for display in a grid on a page. That view is a sub-set of a single table, and can take one of three forms - either all records associated with a client, just those that are overdue, or just those associated with a single invoice.
>
>I'm wondering whether I should have all three views defined seperately in my data environment, or perhaps to just have one and modify it programmatically (I'm not sure how I would do that). Of course, I could also have a single view based upon the client number and then use a filter, but previous experience with filters made me suspect this would be too slow.
>
>Suggestions, please? Tho I have had years of VFP experience, this is the first application I'm writing that is not burdened by the 'old' methods of free tables (no DBC's) and 16-Bit compatibility - it's taking a little relearning to use DBC properties, triggers, views, etc.
>
>TIA
You could use parameterized view and change it on the fly :
* suppose your original SQL for view is like this
create sql view myView as ;
   select * from myTable ;
   where Field1 = ?f1 ;
        and Field2 = ?f2 ;
        and Field3 = ?f3
*DE.Beforeopentables
store "" to f1,f2,f3

*Anytime to change a parameter
f1 = trim(thisform.text1.value)
f2 = trim(thisform.text2.value)
f3 = trim(thisform.text3.value)
requery("myview")
Of course you should take into account when to tableupdate etc.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform