Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

Table of Contents
maxLevel2
absoluteUrltrue

Multiexcerpt include
templateData[]
MultiExcerptNameME_OE_ELT_Snap_Accounts
addpanelfalse
PageWithExcerptELT Aggregate

Overview

Use this Snap to add the LIMIT clause to the incoming SQL query. The LIMIT clause sets an upper limit on the number of records returned by the SQL query. Additionally, you can also specify an offset value so that the Snap displays the records from the specified offset value up to the number of records based on the specified limit. This Snap also allows you to preview the result of the output query. You can validate the modified query using this preview functionality.

Image Modified

Prerequisites

None.

Limitation

Multiexcerpt include macro
nameME_ELT_GBQ_StandardSQL_UOI
pageELT Copy

Known Issues

Limitations

  • This Snap does not support applying an ELT Limit Offset (the value in this field is ignored) when fetching data from an Azure Synapse database.

Multiexcerpt include macro
nameME_ELT_GBQ_StandardSQL_UOI
pageELT Copy

Known Issue

Multiexcerpt include macro
nameME_ELT_KI_Underscore_Refs
pageELT Snap Pack

Snap Input and Output

Input/OutputType of ViewNumber of ViewsExamples of Upstream and Downstream SnapsDescription
Input 

Document

  • Min: 1
  • Max: 1
  • ELT Select
  • ELT Intersect
The SQL query in which you want to add the LIMIT clause.
Output

Document

  • Min: 1
  • Max: 1
  • ELT Copy
  • ELT Insert-Select

The incoming SQL query with the LIMIT clause. 

Snap Settings

Info
titleSQL Functions and Expressions for ELT

You can use the SQL Expressions and Functions supported for ELT to define your Snap or Account settings with the Expression symbol = enabled, where available. This list is common to all target CDWs supported. You can also use other expressions/functions that your target CDW supports.


Parameter NameData TypeDescriptionDefault ValueExample 
LabelString
Insert excerpt
File Writer
File Writer
nopaneltrue
ELT LimitTop 10 Records
Get preview dataCheck box
Multiexcerpt include macro
namegetpreviewdata
pageELT Intersect
Not selectedSelected
ELT LimitIntegerRequired. The maximum number of records to be displayed.N/A3
ELT Limit Offset (Not valid for Azure Synapse and Databricks Lakehouse Platform)Integer

The number of rows from the top that you want to skip. If this field is not configured, then the Snap fetches from the first row of records. For example, if you specify 2 here, then the Snap fetches records from the third row up to the number of rows specified in the ELT Limit field.

Note

This Snap does not support applying an ELT Limit Offset (the value in this field is ignored) when fetching data from an Azure Synapse or a Databricks Lakehouse Platform database.


N/A2

Troubleshooting

None.

Examples

Multiexcerpt macro
namelimitselect

Retrieving a Fixed Number of Records from a Table

In a typical scenario, we use the SELECT command to retrieve records from a table. We can control how many records are retrieved by specifying a WHERE condition. However, if we want to limit the number of records retrieved from the table without any conditions, or if we want to retrieve a fixed number of records starting from a specific row, we must use the SELECT command with the LIMIT clause. This example shows how we can use the ELT Limit Snap to achieve this result.

First, we use the ELT Select Snap to build a query to retrieve all records from the target table.

Upon execution, this Snap builds the query as shown below:

Then, we add the ELT Limit Snap and configure it as needed. In this example, we want to retrieve the next 5 records after the first record. So, we configure the ELT Limit Snap as shown below:

Based on this configuration, the ELT Limit Snap retrieves 5 (ELT Limit field's value) records starting from the second record (ELT Limit Offset field's value)

We can also add an ELT Insert-Select Snap downstream and write the result of this query into another table.

Download this Pipeline.

Downloads

Note
titleImportant Steps to Successfully Reuse Pipelines
  1. Download and import the Pipeline into SnapLogic.
  2. Configure Snap accounts as applicable.
  3. Provide Pipeline parameters as applicable.

Attachments
patterns*.slp, *.zip


Insert excerpt
ELT Snap Pack
ELT Snap Pack
nopaneltrue


See Also

...