> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/table-input.md).

# Table Input

The **Table Input** step reads information from a connected database using SQL statements. Basic SQL statements can be generated automatically by selecting **Get SQL select statement**.

### General

| Field          | Description                                                                                                                                                                                                            |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Step name**  | Specify the unique name of the Table Input step on the canvas. You can customize the name or leave it as the default.                                                                                                  |
| **Connection** | <p>Select the database connection to use.</p><p>If you do not have an existing connection, select <strong>New</strong> or <strong>Wizard</strong>. To modify an existing connection, select <strong>Edit</strong>.</p> |

### Options

| Option                             | Description                                                                                                                                                      |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SQL**                            | SQL statement used to read data from the connected database. You can select **Get SQL select statement** to browse tables and generate a basic SELECT statement. |
| **Store column info in step meta** | Select to use cached metadata stored in the KTR instead of querying the database for table metadata.                                                             |
| **Enable lazy conversion**         | Select to avoid unnecessary data type conversions when possible (can improve performance).                                                                       |
| **Replace variables in script?**   | Select to replace variables in the SQL script. This is useful for testing with or without substitutions.                                                         |
| **Insert data from step**          | Specify the input step that provides parameter values. PDI inserts values at `?` markers in the SQL statement.                                                   |
| **Execute for each row?**          | Select to execute the query for each incoming row.                                                                                                               |
| **Limit size**                     | Number of rows to read. `0` means read all rows.                                                                                                                 |
| **Preview** (button)               | Opens a Preview window and shows a temporary execution log.                                                                                                      |

### Example

```sql
SELECT * FROM customers WHERE changed_date BETWEEN ? AND ?
```

This SQL statement requests two dates that are read from the **Insert data from step** input. You can provide the date range using the [Get System Info](/pdia-data-integration/pdi-transformation-steps-reference-overview/get-system-info.md) step.

### Metadata injection support

You can use [ETL metadata injection](/pdia-data-integration/pdi-transformation-steps-reference-overview/etl-metadata-injection.md) to pass metadata at runtime.

The following fields of the Table Input step support metadata injection:

* **SQL**
* **Limit size**
* **Execute for each row**
* **Replace variables in script**
* **Enable lazy conversion**
* **Cached row meta**
* **Connection**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/table-input.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
