Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized view for no parameter?
Message
From
19/02/2004 11:57:29
 
 
To
19/02/2004 10:13:05
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00877929
Message ID:
00878776
Views:
23
>>>With "SELECT * FROM customer WHERE customer.lastname = ?vp_lastname", it's easy enough to pass "" as the parameter and get all customers, but what about a date(customer.lastdate) or integer(customer.custid)?
>>
>>You could have either a compound WHERE, or you could have a different view for each type of query. CustomersByLastName, ByDate, ByCustID, etc.
>
>Okay, I hate to sound dense, but can you give me an example of the compound WHERE clause? It sounds like the answer I want, but can't quite see.

It's my choice of words, I expect. By "compound" I just mean more than one condition in the WHERE clause. Something like:
SELECT * FROM tastrade!products;
 WHERE (  VAL(Products.supplier_id) = ( ?ln_SupplierID );
   OR  VAL(Products.product_id) = ( ?ln_ProductID ) );
   OR  Products.product_name LIKE ( "%"+?lcProduct_name+"%" )
>SELECT * FROM customers WHERE
> custid gives all records OR custid gives one record

I still would use two different views for this case. lv_customers (all, or all active, for example), and lv_customer (parameterized view).
Previous
Reply
Map
View

Click here to load this message in the networking platform