Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a conditional 'where' clause
Message
From
04/06/1999 15:07:15
 
 
To
04/06/1999 08:38:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00226172
Message ID:
00226654
Views:
21
>I've finally decided that I need two views, one with a parameter, and one without, then I'll just USE whichever I need and ALIAS it to a single name.
>
>Thanks for everybody's suggestions. You'd think this would be easier. I guess what I really am looking for is a view 'class' that I could then sub-class. Guess that doesn't exist -- yet. Have to think about that one for a while, maybe I can come up with something.

Yep... i remembered later how to do this. What you are actually doing is redefining the view that is in the .DBC depending on how you want it... So, you set the lcWhere to what you want, then run the create sql view command. Of course, this will requre each user to have there own .DBC, but that is not a big deal any way.

Another idea is one I have used also... take the SQL from the view and build the where in code... then use SPT to do the view.

One thing I din't know if you knew. If you create a parameterized view, and use like you can just populate the view with a % to get all records...

select * from p1 where p1_function LIKE ?vp_function

Then, you just populate vp_function with your value for that specific record, or % for all records.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform