Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is FoxPro's equivalent of Access's RunSQL command?
Message
De
21/11/1996 17:57:05
 
 
À
21/11/1996 13:45:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00013032
Message ID:
00013082
Vues:
34
>Hi,
>
>I'm trying to execute a SQL statement that I have generated dynamically. In Access, to execute that SQL statement, I can just use
> RunSQL lsSQLString
>
>and it would run the string that I've built.
>
>How do I do that in FoxPro? Is there an equivalent of RunSQL? I can't use ExecSQL because I don't have a back-end. How do I execute SQL strings locally?
>
>Thanks. Any help is greatly appreciated.
>
>Anthony
One of the true beauties of this language/environment is to programatically create program code and execute it as inline macro expansions. The SQL 'string' statement can be constructed in code as a string and then expanded/executed with the &
example
lcSQL='select * from '+laMyTableList[lnI]+' where '+lcCondition
&lcSQL
the last statement will 'dynamically' execute the constructed statement.

You can extended this conceptual model to accessing tables and fields that are exist only at runtime, set properties on arbitrary numbers of created or added objects. etc. Our E-Pub package is data-data driven in that the graphing facility is only 'knows' about a control table that identifies the tables, fields, attributes of the graphs, graph types or interest. The application code only references dynamically created objects, passes parameter objects, and executes macro expanded statements to collect the data and produce the desired graphs. The app is clueless about what it's doing.
Gary
Gary
Helping Make Ideas Reality
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform