# Dynamic SQL row

## ![](/files/OICgLKuth0y95ZV9DuhA) Dynamic SQL row

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

The Dynamic SQL Row transform allows you to execute a SQL statement that is defined in a database field.

The lookup values returned by the transform are added as new fields onto the stream.

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

### Options

| Option                          | Description                                                                                                                                                             |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Transform name                  | Name of the transform; This name has to be unique in a single pipeline                                                                                                  |
| Connection                      | Select a database connection for the lookup                                                                                                                             |
| SQL field name                  | Specify the field that contains the SQL to execute                                                                                                                      |
| Number of rows to return        | Specify the number of records to return. 0 means, return all rows                                                                                                       |
| Outer Join                      | - false: don’t return rows where nothing is found - true: at least return one source row, the rest is NULL                                                              |
| Replace variables               | In case you want to use variables in the SQL, e.g. ${table\_name}, this option needs to be checked.                                                                     |
| Query only on parameters change | If your SQL statements do not change a lot, check this option to reduce the number of physical database queries.                                                        |
| Template SQL                    | In Hop meta and data are separate so you have to specify the meta part in template SQL (field name and type). I mean any statement that returns the same row structure. |


---

# 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/dynamicsqlrow.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.
