ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / SQL functions
  • Running the query
  • Retrieving the query result
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Runs the SQL code of a query created in the query editor.
Caution: The SQLExecWDR function does not start the memory result retrieval process.. The result is retrieved on the first call to one of the following functions: SQLFirst, SQLTable or SQLFetch.
PHP The query is run on a MySQL database.
Example
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)AjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBODBCNative Connectors (Native Accesses)
// Exécuter la requête et récupérer le résultat ligne à ligne
i is int = 0
SQLExecWDR("RequêteClient84")
WHILE SQLFetch("RequêteClient84") = 0    // Il y a encore une ligne à lire
	i++
	// Récupérer les données
	NOM[i] = SQLGetCol("RequêteClient84", 1)
	PRENOM[i] = SQLGetCol("RequêteClient84", 2)
	POSTE[i] = SQLGetCol("RequêteClient84", 3)
	{"IMAGE"+i} = SQLGetMemo("RequêteClient84", 4)
END
SQLClose("RequêteClient84")
Syntax
<Result> = SQLExecWDR(<Name of WDR Query> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Boolean
  • True if the query was executed,
  • False otherwise. If the query was not run, the error message can be returned by the SQL.MesError variable once SQLInfo has been run.
<Name of WDR Query>: Character string
Name of query to be executed. This query was created in the query editor. This name corresponds to the logical query name.
Java The query name must be enclosed in quotes.
<Parameter 1>: Type of parameter, optional
Value of first query parameter. Each parameter must correspond to the expected type. The different parameters are separated by a comma.
<Parameter N>: Type of parameter, optional
Value of Nth query parameter. The parameters must be specified in their initialization order (visible in the query editor). Each parameter must correspond to the expected type. The different parameters are separated by a comma.
Remarks

Running the query

The information regarding the query execution is returned by SQLInfo. The SQL.NbCol variable contains the number of columns found in the query result.
Once it was run and processed, the query must be freed by SQLClose.

Retrieving the query result

Then, the query result can be:
  • Transferred into a table or into a list box (SQLTable).
  • Transferred into controls or variables (SQLAssociate).
  • Retrieved line by line (SQLFetch).
Component: wd300hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/18/2024

Send a report | Local help