AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / Funciones SQL
  • 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
WINDEVWEBDEV - Código ServidorWindowsLinuxJavaCódigo de Usuario (UMC)PHPAjaxHyper File 5.5OLE DBODBC This example executes a query and populates the controls in the Form window with the result of the query.
// Run the query and assign the controls
ResExec = SQLExec("SELECT CUSTNAME, ADDR1, ADDR2, CITY, ZC FROM INV", "QRY2")
IF ResExec = True THEN
// Update bound controls with the values of the result
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")
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local