Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using $ in a parameterized view
Message
De
03/08/1999 12:11:49
 
 
À
03/08/1999 11:12:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00249230
Message ID:
00249273
Vues:
26
Hi Ed!

Thanks for the suggestion. It appears that I will be able to get the results I'm after with this approach. Where should I look for more information on ANSI SQL?

Thanks again

Jim

>Rather than using the internal $ operator, you might try converting to use the ANSI SQL LIKE clause for your compare, prefixing the comparison value with appropriate wildcards for ANSI SQL. If you want to emulate $, the equivalent code is shown below. Note that with a parameterized view, the use of the ? prefix to specify the argument is a view parameter is required:
>
>
SELECT * ;
>  FROM SharedWO ;
>  WHERE Descript LIKE ?cDescription  && this is the Select for the view
>*  avoid putting an alias in place if you don't need it
>
>*  To use it, do the following:
>
>cDescription = '%'+cDescription + '%' && % matches 0 or more characters
>USE <i>my parameterized view name</i>  && opens the parameterized view
>*  This will use the current value of cDescription;  if it is not defined, you
>*  will be prompted for it.  NODATA will open the parameterized view
>*  but will not attempt to read any data, so the cDescription needn't be
>*  defined at the time that the USE statement is issued.  If you use the DE
>*  you'll want to set the NODATAONLOAD property for the view.
>*  On a requery, you should ensure that either the original cDescription is in
>*  scope, or simply redfine it before the requery is issued
>cDescription = '%'+cDescription + '%' && % matches 0 or more characters
>=REQUERY(<i>char expn alias of parameterized view being requeried</i>)
Jim Philippi

quando omni flunkus moritati
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform