|
|
|
|
|
Running a query and handling the result in WLanguage
The selection of records performed by query is not necessarily displayed in a report, in a window, ... This selection can also be used in programming. Most of the HFSQL functions (browse, search, read, ...) can be used both on data files and on the query result. To use these functions on a query, you need to execute the query first (with HExecuteQuery). For example, the Customer34 query selects all the customers whose postal code starts with 34. The PrintCustomer procedure is used to print a proforma invoice for each customer. The following code is used to browse the result of the Customer34 query and to print an invoice for all the selected customers.
ResExecute = HExecuteQuery(Customer34)
IF ResExecute = True THEN
FOR EACH Customer34
PrintCustomer(Customer34.CustomerLName, Customer34.CustomerFName, ...
Customer34.CustomerAddress, Customer34.CustomerZipCode, ...
Customer34.CustomerCity)
END
ELSE
Error("The query was not run.")
END
- Analysis password: If the query is associated with an analysis protected by password at runtime, this password must be specified when opening the analysis (HOpenAnalysis) in the initialization process of the project.
- File password: If the query is based on one or more password-protected files, specify the passwords with HPass before executing the query (with HExecuteQuery).
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|