ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Example: Initializing and browsing an SQL query
  • Example: Connecting to an SQL Server database and executing a query
HExecuteSQLQuery (Example)
Example: Initializing and browsing an SQL query
HFSQL ClassicHFSQL Client/ServerNative Connectors (Native Accesses) The following example is used to initialize a query and to browse it. This example uses the Data Source type to handle the query.
MyQuery is Data Source
// Initializes the query
IF NOT HExecuteSQLQuery(MyQuery, ...
"SELECT LASTNAME,FIRSTNAME FROM CUSTOMER WHERE CUSTOMER.LASTNAME = 'SMITH'") THEN
Error("Error while initializing the query" + CR + HErrorInfo())
RETURN
END
 
// Read the first record of the query
HReadFirst(MyQuery)
WHILE NOT HOut()
  // Process on the query record
  // Access to the items via MyQuery.<Item name>
  ...
  // Read the next record
  HReadNext()
END
Example: Connecting to an SQL Server database and executing a query
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help