Run SQL statement
Run one SQL statement and return its rows as a data table. Use ? in the SQL for values passed in bindings.
Command in the Snowflake toolkit · id ooa.snowflake/execute_statement · 11 inputs (1 required), 5 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Account address (URL) | String | No | Your Snowflake account address, e.g. https://myorg-myaccount.snowflakecomputing.com. | |
| SQL statement | String | Yes | SQL to run. Put ? where each binding value goes. | |
| Bindings | List | No | Values for the ? placeholders, in order, e.g. ["EMEA", 1000]. | |
| Warehouse | String | No | Warehouse that runs the query. Leave empty for the user's default warehouse. | |
| Database | String | No | Database to use for names that are not fully written out. | |
| Schema | String | No | Schema to use for names that are not fully written out. | |
| Role | String | No | Role to run as. Leave empty for the user's default role. | |
| Wait (seconds) | Number | No | 600 | How long to wait for the statement to finish before returning with status running. |
| Maximum rows | Number | No | 100000 | Most rows to bring back into the table. |
| Token | Credential | No | Access token from the vault: an OAuth token, a key-pair JWT or a programmatic access token. Or leave it empty and choose a connection that signs in, which gets and renews the token. | |
| Token type | String | No | OAUTH | Kind of token in the vault: OAUTH, KEYPAIR_JWT or PROGRAMMATIC_ACCESS_TOKEN. |
Outputs
| Output | Type | What it is |
|---|---|---|
| table | Table | Result rows (empty for statements that return no rows). |
| row_count | Number | Number of rows in the table. |
| rows_affected | Number | Rows inserted, updated or deleted by a data change. |
| statement_handle | String | Id of the statement, for status, results or cancel. |
| status | String | succeeded, or running when it did not finish within the wait time. |