ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Example 1: Simple generic search
  • Example 2: Performing a search on a composite key
  • Example 3: Seeking a customer with condition
HReadSeek (Example)
Example 1: Simple generic search
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)PHPAjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)
The following example is used to perform a generic search on the customer name. If the customer is found, the CustomerFound procedure is run ; if no customer is found, the UnknownCustomer procedure is run.
// Simple generic search
HReadSeek(CUSTOMER, CUSTNAME, sCustName)
IF HFound(CUSTOMER) = True THEN
CustomerFound()
ELSE
UnknownCustomer()
END
Example 2: Performing a search on a composite key
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)PHPAjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)
The following example is used to perform a search on a composite key (last name and first name). The customers found are deleted.
// Find the record
HReadSeek(CUSTOMER, LASTNAME_FIRSTNAME, [sLastName, sFirstName])
 
WHILE HFound(CUSTOMER) = True
// Deletion
HDelete(CUSTOMER)
HReadNext(CUSTOMER,LASTNAME_FIRSTNAME)
END
Example 3: Seeking a customer with condition
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)PHPAjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)
This example is used to find a customer whose turnover is greater than a specified value.
HReadSeek(CUSTOMER, Turnover, X)
WHILE HOut(CUSTOMER) = False
Add_Customer_List()
HReadNext(CUSTOMER)
END
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