Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Frustrating view behaviour in 9.0
Message
De
19/01/2005 08:54:10
Emmanuel Huybrechts
Technimeca International Corp.
Montréal, Québec, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Titre:
Frustrating view behaviour in 9.0
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
00978506
Message ID:
00978506
Vues:
58
While it's not mentionned in the documentation, macro substition in the WHERE clause of a CREATE SQL VIEW statement is
no longer supported as in prior versions (because of improved statement
validation according to Jim Saunders).

We have now to put a ? after the &
That's fine, but we also have to make sure the variable used for macro-substitution is in scope! Like this:
CREATE DATABASE testMacro
CREATE TABLE testMacro (f1 I)
APPEND BLANK
APPEND BLANK

pFilter=".T."

CREATE SQL VIEW exampl AS SELECT temp.* FROM testMacro temp WHERE
&?pFilter

DBSetProp("exampl","View","ParameterList","pFilter,'C'") 
It means that even if you do :
USE testMacro!exampl NODATA
You'll still need to have the variable pFilter in scope ! That behaviour was not happening in previous VFP versions. The problem is: I can't use VFP 9 because this new behaviour breaks existing application created in VFP 8. I wished we had a "SET ..." command allowing to bypass this new behaviour. This behaviour should be added in "Critical changes" section of the documentation or at least in the readme file.

To the VFP team: please, fix this problem, I want to use 9.0 !

One more thing, the ? doesn't work very well either. If you open the view (without using NODATA), it will ask for the parameter but any value you supply will give a syntax error.
Répondre
Fil
Voir

Click here to load this message in the networking platform