ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Query editor
  • Overview
  • Password
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Running a query and handling the result in WLanguage
Overview
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.
// Execute query
ResExecute = HExecuteQuery(Customer34)
// Error while running the query?
IF ResExecute = True THEN
	// Browse the result of the query
	FOR EACH Customer34
	   	// Print the invoice for each record
		PrintCustomer(Customer34.CustomerLName, Customer34.CustomerFName, ...
				Customer34.CustomerAddress, Customer34.CustomerZipCode, ...
				Customer34.CustomerCity)
	END
ELSE
	 // Display the error message
	 Error("The query was not run.")
END
Password
  • 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).
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/04/2024

Send a report | Local help