AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / Funciones SQL
  • SQLFetch/SQLFetch: Partial retrieval of query results
  • Life cycle of a browse
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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.
PHP The SQL functions are used to handle the MySQL databases and the databases accessible by ODBC (HFSQL for example).
WEBDEV - Código Navegador The SQL functions are used to handle the local databases (such as Web SQL databases). Only the SQLFetch/SQLGetCol browse mode is available. For more details, see Accessing a database in local mode (SQLite).
Ejemplo
WINDEVWEBDEV - Código ServidorReportes y ConsultasJavaCódigo de Usuario (UMC)AjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBODBCConectores Nativos
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")
Sintaxis
<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.
WEBDEV - Código Navegador Only the queries created and run by SQLExec are available.
Observaciones

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.
LinuxPHP

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).
Componente: wd300hf.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 28/03/2025

Señalar un error o enviar una sugerencia | Ayuda local