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
  • SQLFetch/SQLFetch: Partial retrieval of query results
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Goes to the next row (i.e next record) of the query result.
When SQLFetch is called for the first time, the current record will be the first record selected by the query.
This function is used to browse the query result "line by line". For more details on the different modes to loop through a query result, see Types of SQL browse.
Example
HFSQL ClassicHFSQL Client/ServerNative Connectors (Native Accesses)
i is int = 0
SQLExec("SELECT NOM, PRENOM, POSTE, PHOTO FROM CLIENT", "REQ1")
// Récupérer la requête ligne à ligne
WHILE SQLFetch("REQ1") = 0
	// Il y a encore une ligne à lire
	i++
	// Récupérer les données
	NOM[i] = SQLGetCol("REQ1", 1)
	PRENOM[i] = SQLGetCol("REQ1", 2)
	POSTE[i] = SQLGetCol("REQ1", 3)
	{"IMAGE"+i} = SQLGetMemo("REQ1", 4)
END
SQLClose("REQ1")
Syntax
<Result> = SQLFetch(<Query name>)
<Result>: Integer
0 if the record was successfully read. The data can be retrieved by SQLGetCol and SQLGetMemo.
<Query name>: Character string
Remarks

SQLFetch/SQLFetch: Partial retrieval of query results

The function SQLFetch FUNCTION function does not retrieve all rows in the query result: only the current record is retrieved by the SQLFetch FUNCTION..
Therefore, the total number of result rows (SQL.NbLine) cannot be retrieved by SQLInfo if SQLFetch is used to browse the result.
Component: wd300hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help