Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized View With Integer?
Message
From
07/11/1997 11:39:12
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00058639
Message ID:
00058898
Views:
28
>
>>>I have a parameterized view with two view parameters. One parameter is a string, the other an integer. I'd like to be able to select all records in the view, but when I leave the integer view parameter blank I get a "data type mismatch" error. Obviously, this is because the empty vp is being converted to a string. How do I make the view so that I don't have to put a value in the integer view parameter?
>>
>>What about converting the single integer view parameter into two integers that form a range search:
>>
>>WHERE column = ?vp_integer
>>
>>becomes
>>
>>WHERE column BETWEEN ?vp_integer1 AND ?vp_integer2.
>>
>>If you want to find a specific value set vp_integer1 = vp_integer2 = value
>>To ignore the integer view parameter set vp_integer1 to something very small and vp_integer2 to something very large.
>>
>>-Mike
>

>
>Actually, I solved this problem by using an expression in the field for the view parameter. So, instead of : "address.ad_key = ?vp_key" I now have "Alltrim(Str(address.ad_key)) = ?vp_key". Works great. If I leave my view parameters blank, all records are selected.

Remember that for this view to be optimized, you must have an index on Alltrim(Str(address.ad_key)).
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform