PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • SQLFetch: Partial retrieval of the query result
  • Life cycle of a browse
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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.
Java To optimize performance, we recommend that you use a SQLFirst/SQLNext browse.
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
WINDEVJavaUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBODBCNative Connectors (Native Accesses)
i is int = 0
SQLExec("SELECT LASTNAME, FIRSTNAME, EXTENSION, PHOTO FROM CUSTOMER", "QRY1")
// Retrieve the query row by row
WHILE SQLFetch("QRY1") = 0
// There is still another row to read
i++
// Retrieve the data
LASTNAME[i] = SQLGetCol("QRY1", 1)
FIRSTNAME[i] = SQLGetCol("QRY1", 2)
EXTENSION[i] = SQLGetCol("QRY1", 3)
{"IMAGE"+i} = SQLGetMemo("QRY1", 4)
END
SQLClose("QRY1")
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
Java The queries created with the query editor must be specified in the format of a character string.
Remarks

SQLFetch: Partial retrieval of the query result

SQLFetch does not retrieve all the rows of the query result: SQLFetch only returns the current record.
Therefore, the total number of result rows (SQL.NbLine) cannot be retrieved by SQLInfo if SQLFetch is used to browse the result.
Linux

Life cycle of a browse

The time it takes SQLFetch to retrieve data from the result is limited to the execution time of the PHP script. SQLFetch cannot continue to retrieve data after the page is returned (even in Session mode).
Component: wd270hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment