Paginated SQL Query
  • 05 Aug 2021
  • 1 Minute to read
  • Dark
    Light

Paginated SQL Query

  • Dark
    Light

Article summary

Example Lab Article
While Example Lab projects are resources for public use, articles and assets are not actively maintained. Screenshots and features are from the specified version below. These references may become dated as new versions are released.


Overview

Example Lab Details

Version6.16
Root FolderExample Lab - Paginated SQL Query
Modules None
DependenciesNone

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.

Reference Articles


Project Download

The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 6.16 or later using our Importing/Exporting article.




Was this article helpful?