Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
V6s5 - How to make Parameterized Views return all record
Message
From
17/03/2004 05:12:35
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00886996
Message ID:
00887000
Views:
22
This message has been marked as the solution to the initial question of the thread.
>Hi all
>
>I have these views with parameters specified in them, whenever they are opened they ask for the relevant parameter value.
>
>Now could I pass (or rather not pass) a parameter and the view returns all the records. Currently not passing a parameters returns a blank view.

At the end there would be a value. But design it so that it includes all when it gets an empty value. ie:
For character :

myField = ?cValue
vs:
myField between ?cValue1 and ?cValue2

store 'Bhavbhuti' to m.cValue1, m.cValue2 && would return single
m.cValue1 = ''
m.cValue2 = chr(255) && would return all

If ansi is off :
myField = ?cValue && would return all for m.cValue = ''

For numeric :
between ?nVal1 and ?nVal2
and put possible lowest/highest values for all.

Alternatively I create temp cursors as join cursors and put values I want to be included in them. This approach lets me to pickup values that I can't define with a continous range. If it's from a backend such as SQL server either I use a stored proc or create a temp table to join in SQL server or use OpenRowSet() to use my local table as a join table.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform