# Add Sequence

## ![](/files/Jr0suOa8Oy1S6Z3paeQT) Add Sequence

### Description <a href="#description" id="description"></a>

The Add Sequence transform adds a sequence to the Hop stream. A sequence is an ever-changing integer value with a specific start and increment value.

You can either use a database sequence (if supported, e.g. Oracle, PostgreSQL) to determine the value of the sequence, or have it generated by Hop.

Hop-generated sequence values are unique when used in the same pipeline, and return to the same starting value each time you run the pipeline. Hop sequences are unique only when used in the same pipeline. Also, they are not stored, so the values start back at the same value every time the pipeline is launched.

### Supported Engines <a href="#supported_engines" id="supported_engines"></a>

| Hop Engine | <sup>✓</sup> |
| ---------- | ------------ |
| Spark      | <sup>✓</sup> |
| Flink      | <sup>✓</sup> |
| Dataflow   | <sup>✓</sup> |

### Options

| Option                                          | Description                                                                                                                                                                                                   |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Transform name                                  | The name of this transform as it appears in the pipeline workspace. This name must be unique within a single pipeline.                                                                                        |
| Name of value                                   | Name of the new sequence value that is added to the stream.                                                                                                                                                   |
| Use DB to generate the sequence                 | Enable if you want the sequence to be driven by a database sequence, then set these parameters: Connection name, Schema name (optional), Sequence name.                                                       |
| Connection name                                 | The name of the connection on which the database sequence resides.                                                                                                                                            |
| Schema name (optional)                          | The table’s schema name.                                                                                                                                                                                      |
| Sequence name                                   | The name of the database sequence.                                                                                                                                                                            |
| Use a pipeline counter to generate the sequence | Enable if you want the sequence to be generated by Hop, then set these parameters: Counter name (optional), Start at, Increment by, Maximum value.                                                            |
| Counter name (optional)                         | If multiple transforms in a pipeline generate the same value name, this option enables you to specify the name of the counter to associate with. Avoids forcing unique sequencing across multiple transforms. |
| Start at                                        | The value to begin the sequence with.                                                                                                                                                                         |
| Increment by                                    | The amount by which the sequence increases or decreases.                                                                                                                                                      |
| Maximum value                                   | The value after which the sequence returns to the Start At value.                                                                                                                                             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.primeur.com/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/addsequence.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
