PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • SQLFetch: Partial retrieval of the query result
  • Lifespan of a browse
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
Goes to the next line (which means to the next record) of the query result.
During the first call to SQLFetch, the current record will be the first record selected by the query.
This function is used to browse the query result "line by line". See Types of SQL browse for more details.
Java To optimize the performances, we recommend that you use a SQLFirst/SQLNext browse.
PHP The SQL functions are used to handle the MySQL databases and the databases accessible by ODBC (HFSQL for example).
Versions 16 and later
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). Only the SQLFetch/SQLGetCol browse mode is available. See Accessing a database in local mode (SQLite) for more details.
New in version 16
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). Only the SQLFetch/SQLGetCol browse mode is available. See Accessing a database in local mode (SQLite) for more details.
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). Only the SQLFetch/SQLGetCol browse mode is available. See Accessing a database in local mode (SQLite) for more details.
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
i is int = 0
SQLExec("SELECT LASTNAME, FIRSTNAME, EXTENSION, PHOTO FROM CUSTOMER", "QRY1")
// Retrieve the query line by line
WHILE SQLFetch("QRY1") = 0
        // There is still another line 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 (with or without quotes)
  • Name of the query created and run by SQLExec (with quotes),
  • Name of the query run by SQLExecWDR (with or without quotes).
Java The queries created with the query editor must be specified in the format of a character string with quotes.
Versions 16 and later
WEBDEV - Browser code Only the queries created and run by SQLExec are available.
New in version 16
WEBDEV - Browser code Only the queries created and run by SQLExec are available.
WEBDEV - Browser code Only the queries created and run by SQLExec are available.
Remarks

SQLFetch: Partial retrieval of the query result

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

Lifespan of a browse

The lifespan of a browse performed by SQLFetch is limited to the lifespan of the PHP script. No browse can be continued with SQLFetch once the page was returned (even in session mode).
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
WEBDEV - Browser code WDJS.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