PRB: Parameterized View Discrepancy Using IN() Filter Criteria (156631)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q156631 SYMPTOMS
A Parameterized View returns incorrect results when assigning multiple
string values to a parameter of the IN() Filter criteria.
CAUSE
The View Designer is not designed to handle queries where multiple values
are assigned to a parameter in the IN() clause.
WORKAROUND
To use View Designer to create a parameterized View that returns the
correct values when using the IN() filter criteria, you need to specify
multiple parameters instead of a single one. For example, you would specify
the following in the Filter tab of the View:
Field Name = "customer.customer_id"
Criteria = IN
Example = ?a, ?b, ?c
This will produce the following SQL statement:
SELECT *;
FROM tastrade!customer;
WHERE Customer.customer_id IN (?a, ?b, ?c)
When you browse the View, it prompts you three times to enter each of the
three parameters. If, for example, you enter "ALFKI," "ANATR," and "ANTON"
as the first, second, and third parameters, respectively for the
parameters, then three records display correctly. Alternately, you can
assign the strings, for example "ALFKI," "ANATR," and "ANTON" respectively,
to each of the variables a, b, and c respectively before browsing the View.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 10/15/2003 |
---|
Keywords: | KB156631 |
---|
|