The information in this article applies to:
SUMMARY
Using macro substitution or wildcards in a SELECT-SQL statement allows the
data to be defined, extracted, and accessed dynamically.
MORE INFORMATIONThe following program example uses macro substitution to dynamically change the query output generated by the SELECT-SQL statement. The macro substitution is in the SQL WHERE clause.
NOTE: When you are using macro substitution for the entire SELECT-SQL
statement in a stand-alone executable file, for example
the macro must be addressed before the macro or command is translated. To
resolve this issue and avoid possible errors, include the necessary source
code in a separate procedure file in the project prior to compiling the
executable file, as shown in the following program example:
If the NotUsed procedure is NOT added to the project, the user will receive
a "Feature not available" error message at run time.
Note that if you are using macro substitution in one or more clauses of the SELECT statement, for example
the NotUsed procedure is NOT required.
The following program uses a wildcard to dynamically reference multiple field names in a SELECT-SQL statement. The following query contains all fields used in both the CUSTOMER.DBF and INVOICES.DBF files that have matching CNO keys.
Optionally, you can use a wildcard with a work area alias by entering the
filename, a period, and then an asterisk. The following SELECT-SQL
statement contains all fields used in the CUSTOMER file (which is suffixed
with an asterisk); the CNO and SALESMAN fields are displayed as output from
the INVOICES.DBF file for all records that contain matching CNO keys in
both files.
REFERENCES
FoxPro for MS-DOS "Developer's Guide," version 2.0, page D16-11 Additional query words: FoxMac FoxDos FoxWin memvar wild card
|
|
Last Reviewed: August 24, 1999 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |