Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized View
Message
From
31/10/1997 16:34:29
 
 
To
31/10/1997 16:14:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00057664
Message ID:
00057670
Views:
31
>I have a view with 4 parameters. If only one of the parameters has a value, what do I fill the other parameters with so that I get back records that match the one parameter I have? For instance, if my view parameters are vp_idnum, vp_last, vp_first & vp_middle and I only have a value in vp_idnum, how do I keep from getting back all the records in the table (because the other parameters have "")? Also, if vp_last contains only "A", how do I get back all records that have last name beginning with "A"?

Try something like this:

CREATE SQL VIEW vCustomer AS ;
SELECT * FROM customer WHERE cu_fname LIKE ?m.fname AND cu_lname LIKE ?m.lname

To find all the customers that begin with 'A':

fname = "A%"
lname = "%"
USE vCustomer IN 0

The '%' is the ANSI wildcard character that matches zero or more characters.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform