PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Running the query
  • Retrieving the query result
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Runs the SQL code of a query created in the query editor.
Caution: SQLExecWDR does not start the process for retrieving the result in memory. The result is retrieved during the first call to one of the following functions: SQLFirst, SQLTable or SQLFetch.
PHP The query is run on a MySQL database.
Versions 19 and later
Android Widget This function is now available in Android Widget mode (accessing the external databases via a Webservice).
Android This function is now available for the Android applications (accessing the external databases via a Webservice).
iPhone/iPad This function is now available for the iPhone/iPad applications (accessing the external databases via a Webservice).
New in version 19
Android Widget This function is now available in Android Widget mode (accessing the external databases via a Webservice).
Android This function is now available for the Android applications (accessing the external databases via a Webservice).
iPhone/iPad This function is now available for the iPhone/iPad applications (accessing the external databases via a Webservice).
Android Widget This function is now available in Android Widget mode (accessing the external databases via a Webservice).
Android This function is now available for the Android applications (accessing the external databases via a Webservice).
iPhone/iPad This function is now available for the iPhone/iPad applications (accessing the external databases via a Webservice).
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
WINDEVWEBDEV - Server codeReports and QueriesJavaAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBODBCNative Accesses
// Run the query and retrieve the result line by line
i is int = 0
SQLExecWDR("QueryCustomer84")
WHILE SQLFetch("QueryCustomer84") = 0// There is still another line to read
        i++
        // Retrieve the data
        NAME[i] = SQLGetCol("QueryCustomer84", 1)
        FIRSTNAME[i] = SQLGetCol("QueryCustomer84", 2)
        EXTENSION[i] = SQLGetCol("QueryCustomer84", 3)
        {"IMAGE"+i} = SQLGetMemo("QueryCustomer84", 4)
END
SQLClose("QueryCustomer84")
Syntax
<Result> = SQLExecWDR(<Name of WDR Query> [, <Parameter 1> [, ...  [ , <Parameter N>]]])
<Result>: Boolean
  • True if the query was run,
  • 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 (with or without quotes)
Name of query to run. 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).
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment