ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / SQL functions
  • Example 1: Reading the records without partial fetch
  • Example 2: Reading the records by partial fetch
SQLFirst (Example)
Example 1: Reading the records without partial fetch
This example runs a query and retrieves the query result directly.
SQLExec("select * from orderline", "Qry1")
SQLFirst("Qry1")
WHILE NOT SQL.Out
// CODE FOR PROCESSING RECORDS
// Go to the next one
SQLNext("Qry1")
END
Example 2: Reading the records by partial fetch
WEBDEV - Server codeWindowsPHPAjaxOLE DBODBC This example runs a query and retrieves the query result by partial fetch.
Multitask is required in order for the program not to go in active wait. If there is an active wait (no Multitask), the retrieval will be performed and there will be an endless loop.
SQLExec("select * from orderline", "Qry1")
// Retrieve 100 records in a background task
SQLFirst(100, "Qry1")
// We must be in the process of retrieval or not outside
WHILE SQL.Retrieving OR NOT SQL.Out
WHILE NOT SQL.Out
// CODE FOR PROCESSING RECORDS
    // Go to the next one
    SQLNext("Qry1")
END
Multitask(20)
// Attempt to go to the next record
//(updates the SQL.Out variable)
SQLNext("Qry1")
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help