Skip to main content

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​

InputTypeRequiredDefaultWhat it is
Account address (URL)StringNoYour Snowflake account address, e.g. https://myorg-myaccount.snowflakecomputing.com.
SQL statementStringYesSQL to run. Put ? where each binding value goes.
BindingsListNoValues for the ? placeholders, in order, e.g. ["EMEA", 1000].
WarehouseStringNoWarehouse that runs the query. Leave empty for the user's default warehouse.
DatabaseStringNoDatabase to use for names that are not fully written out.
SchemaStringNoSchema to use for names that are not fully written out.
RoleStringNoRole to run as. Leave empty for the user's default role.
Wait (seconds)NumberNo600How long to wait for the statement to finish before returning with status running.
Maximum rowsNumberNo100000Most rows to bring back into the table.
TokenCredentialNoAccess 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 typeStringNoOAUTHKind of token in the vault: OAUTH, KEYPAIR_JWT or PROGRAMMATIC_ACCESS_TOKEN.

Outputs​

OutputTypeWhat it is
tableTableResult rows (empty for statements that return no rows).
row_countNumberNumber of rows in the table.
rows_affectedNumberRows inserted, updated or deleted by a data change.
statement_handleStringId of the statement, for status, results or cancel.
statusStringsucceeded, or running when it did not finish within the wait time.