- 05 Aug 2021
- 1 Minute to read
- Print
- DarkLight
Paginated SQL Query
- Updated on 05 Aug 2021
- 1 Minute to read
- Print
- DarkLight
Overview
Example Lab Details | |
Version | 6.16 |
Root Folder | Example Lab - Paginated SQL Query |
Modules | None |
Dependencies | None |
This project demonstrates how a SQL query can be used to fetch paginated data through a Flow. Pagination describes data that has been split into groups called "pages" that are used to limit the data returned when retrieving it.
Explanation
This project includes a Query called "GetAccountsWithPagination" and a Flow called "Paginated Fetch." The query uses the filters "OFFSET x ROWS" and "FETCH NEXT y ROWS" to limit the data to a page where x indicates the page and y indicates the page size. The Flow has an input called PageNumber and Page Size. PageSize is multiplied by PageNumber to determine the offset. The calculated offset and page size are passed into the Query to get the specified page of data. Due to the way OFFSET works, PageNumber start at 0. PageSize must be greater than 0.