PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example 1: Running a query without naming it
  • Example 2: Running a query and assigning its result to the controls of a query
  • Example 3: Running a query and retrieving information about this query
Example 1: Running a query without naming it
This example is used to run a deletion query without naming it. This query will return no result.
ResExec = SQLExec("DELETE CUSTOMER WHERE CUSTNUM = " + CustomerNum, "QRY1")
IF ResExec = False THEN
// Processes the error
END
Example 2: Running a query and assigning its result to the controls of a query
WINDEVWindowsLinuxJavaUser code (UMC)Hyper File 5.5OLE DBODBC This example is used to run a query and to assign the query result to the controls of the Form window.
// Run the query and assign the controls
ResExec = SQLExec("SELECT CUSTNAME, ADDR1, ADDR2, CITY, ZC FROM INV", "QRY2")
IF ResExec = True THEN
// Transfer the result into the associated controls
SQLAssociate("QRY2", CustName, Addr[1], Addr[2], City, ZipCode)
// Display the first one
SQLFirst("QRY2")
ELSE
// Processes the error
END
SQLClose("QRY2")
Example 3: Running a query and retrieving information about this query
This example is used to get information about the query run.
// Run the controls and retrieve the information
SQLExec("SELECT* FROM INV", "QRY1")
SQLInfo("QRY1")
IF ResExec = False THEN
Info("Error while running the query: " + SQL.MesError)
ELSE
Info("Number of columns: " + SQL.NbCol)
END
SQLClose("QRY1")
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment