Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using parameterized views
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00322466
Message ID:
00322756
Views:
21
Stephane,

I think you'll find that there will be cases going both ways. For instance, you could have a view with a query like:

SELECT *
FROM authors
WHERE au_lname LIKE ?p_lname AND au_fname LIKE ?p_fname

You could specify a value of "%" for either p_lname or p_fname and SQL would match all.

If you need total flexiblitiy, you'll probably be happier with SQL Pass-Through (SPT). Using SPT, you'll dynamically create a query and submit it to the server:

hConn = SQLCONNECT(...)
lcSQL = "SELECT * FROM authors WHERE au_lname LIKE 'W%'"
lnResult = SQLEXEC(hConn, lcSQL)

The downside is that the result set will not be updatable although there are a handful of cursor properties that you can set to make it so.

My personal opinion, is to use SPT and call stored procedures. You'll be required to know the different variations of queries but overall you'll get the best performance.

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

Click here to load this message in the networking platform