Snowflake

Usage Instructions

Connect with a Snowflake programmatic access token to execute SQL, synchronize structured rows, load and unload staged data, browse databases and schemas, size and control warehouses, run and schedule tasks, review query and load history, inspect schemas, and call stored procedures.

Actions

Snowflake Execute SQL

Execute one parameterized SQL statement through the Snowflake SQL API.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringNoDatabase context for this statement
schemastringNoSchema context for this statement
statementstringYesOne Snowflake SQL statement to execute
bindingsjsonNoSnowflake bindings keyed by 1-based position, each with type and string value
asyncbooleanNoReturn immediately with a statement handle

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Statement

Check a running or completed statement and retrieve exactly one result partition. Canceled or failed statements are returned as errors.

Input

ParameterTypeRequiredDescription
statementHandlestringYesStatement handle returned by Snowflake
partitionnumberNoZero-based result partition to retrieve; defaults to 0
partitionCountnumberNoTotal number of result partitions, taken from the partitionCount of the first partition. Snowflake omits metadata from every later partition response, so supply this when fetching partition 1 or higher to keep truncated and nextPartition accurate

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Cancel Statement

Cancel a running Snowflake SQL API statement.

Input

ParameterTypeRequiredDescription
statementHandlestringYesStatement handle returned by Snowflake

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Insert Rows

Insert structured JSON rows using bound values.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTarget Snowflake table name within the selected database and schema context
rowsjsonYesNon-empty JSON array of row objects with matching keys. For bulk loads, stage the files and use Load Data instead.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Update Rows

Update matching rows with a bound MERGE statement without inserting new rows.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTarget Snowflake table name within the selected database and schema context
rowsjsonYesNon-empty JSON array of row objects with matching keys. For bulk loads, stage the files and use Load Data instead.
matchColumnsarrayYesColumns used to match target rows. Match values must be non-null and unique across the submitted rows.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Upsert Rows

Update matching rows and insert unmatched rows with a bound MERGE statement.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTarget Snowflake table name within the selected database and schema context
rowsjsonYesNon-empty JSON array of row objects with matching keys. For bulk loads, stage the files and use Load Data instead.
matchColumnsarrayYesColumns used to match target rows. Match values must be non-null and unique across the submitted rows.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Delete Rows

Delete rows matching a required set of bound column filters.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTarget Snowflake table name within the selected database and schema context
filtersjsonYesNon-empty JSON object of column filters combined with AND. A null value matches rows where that column IS NULL; every other value is compared for equality against a bound parameter.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Load Data

Load files from an existing Snowflake stage with COPY INTO.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringYesTarget database name
schemastringYesTarget schema name
tablestringYesTarget table name
stagePathstringYesExisting stage path, for example @my_stage/path
fileFormatstringNoOptional named file format
patternstringNoOptional regular expression used to select staged files
onErrorstringNoCOPY error handling: ABORT_STATEMENT, CONTINUE, SKIP_FILE, SKIP_FILE_<count>, or SKIP_FILE_<percent>%
purgebooleanNoRemove successfully loaded files from the stage
forcebooleanNoReload files even when Snowflake has loaded them before
matchByColumnNamestringNoCASE_SENSITIVE, CASE_INSENSITIVE, or NONE

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Unload Data

Export a Snowflake table to files in a stage with COPY INTO.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringYesDatabase name
schemastringYesSchema name
stagePathstringYesDestination stage reference, for example @EXPORTS/daily
tablestringYesSource table to unload. To export a query result, materialize it first as a view or with CREATE TABLE AS SELECT, then unload that
fileFormatstringNoNamed file format applied to the unloaded files
headerbooleanNoWhether to write column headings into the unloaded files; supported for CSV and Parquet only
overwritebooleanNoWhether to replace existing files with matching names in the stage
singleFilebooleanNoWhether to write one file instead of splitting the output across files
maxFileSizeBytesnumberNoUpper size limit per unloaded file in bytes; Snowflake defaults to 16777216 (16 MB) and allows up to 5368709120 (5 GB)

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Databases

List the databases the credential can access.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
nameLikestringNoOptional SQL LIKE pattern for object names
limitnumberNoMaximum rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Schemas

List the schemas in a Snowflake database.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
nameLikestringNoOptional SQL LIKE pattern for object names
limitnumberNoMaximum rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Tables

List the tables in a Snowflake schema.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
nameLikestringNoOptional SQL LIKE pattern for object names
limitnumberNoMaximum rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Warehouses

List warehouses visible to the active Snowflake role.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
nameLikestringNoOptional SQL LIKE pattern for warehouse names

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Warehouse

Get the full details for a Snowflake virtual warehouse.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehouseNamestringYesWarehouse name

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Resume Warehouse

Resume a Snowflake virtual warehouse if it is suspended.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehouseNamestringYesWarehouse name

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Suspend Warehouse

Suspend a Snowflake virtual warehouse.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehouseNamestringYesWarehouse name

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Alter Warehouse

Resize a Snowflake warehouse or change its auto-suspend and auto-resume settings.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehouseNamestringYesWarehouse name
warehouseSizestringNoNew warehouse size, one of ${SNOWFLAKE_WAREHOUSE_SIZES.join(', ')}
autoSuspendSecondsnumberNoSeconds of inactivity before the warehouse suspends. Snowflake polls every 30 seconds, so values under 30 or not a multiple of 30 may not behave as expected. 0 means the warehouse never suspends and keeps consuming credits
autoResumebooleanNoWhether the warehouse resumes automatically when a statement is submitted

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Tasks

List tasks in a Snowflake schema.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
nameLikestringNoOptional SQL LIKE pattern for task names
limitnumberNoMaximum task rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Task

Describe a Snowflake task.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
taskNamestringYesTask name

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Run Task

Run a Snowflake task immediately, optionally retrying its last failed graph.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
taskNamestringYesTask name
retryLastbooleanNoRetry the last failed task graph run

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Resume Task

Resume a suspended Snowflake task so its schedule runs again.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
taskNamestringYesTask name without a database or schema prefix

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Suspend Task

Suspend a Snowflake task so its schedule stops triggering runs.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
taskNamestringYesTask name without a database or schema prefix

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Task Runs

Query up to seven days of Snowflake task history, capped at 10000 rows.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
taskNamestringNoOptional task name filter. TASK_HISTORY supports only non-qualified task names, so pass DAILY_LOAD rather than DB.SCHEMA.DAILY_LOAD
startTimestringNoOptional scheduled-time range start as an ISO timestamp within the last seven days
endTimestringNoOptional scheduled-time range end as an ISO timestamp within the last seven days
errorOnlybooleanNoReturn only task runs that failed or were cancelled
limitnumberNoMaximum task runs, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Task Run

Find one task history record by query ID within Snowflake’s seven-day window and 10000 most recent records after optional filters.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
queryIdstringYesTask run query ID from TASK_HISTORY
taskNamestringNoOptional task name used to narrow the 10000-record history window. TASK_HISTORY supports only non-qualified task names, so pass DAILY_LOAD rather than DB.SCHEMA.DAILY_LOAD
startTimestringNoOptional scheduled-time range start as an ISO timestamp within the last seven days
endTimestringNoOptional scheduled-time range end as an ISO timestamp within the last seven days

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Cancel Task Query

Cancel one running task query by query ID with SYSTEM$CANCEL_QUERY. Task runs already in flight are unaffected and must be cancelled individually; a cancelled child marks the task graph run failed, so downstream tasks are skipped.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
queryIdstringYesQuery ID of the single running task query to cancel, taken from TASK_HISTORY. Cancels only that query.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Task Run Output

Read a task query result with RESULT_SCAN during Snowflake’s 24-hour retention window using the task owner role.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
queryIdstringYesCompleted task query ID; task results require the task owner role, while manual query results require the same user

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Query History

List queries that completed in the last seven days, optionally filtered.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
userNamestringNoOnly queries run by this user; cannot be combined with warehouseName
warehouseNamestringNoOnly queries run on this warehouse; cannot be combined with userName
startTimestringNoISO-8601 start of the query completion window, within the last seven days
endTimestringNoISO-8601 end of the query completion window, within the last seven days
errorOnlybooleanNoWhether to return only queries that failed (execution status FAILED_WITH_ERROR or FAILED_WITH_INCIDENT). Snowflake applies the limit before this filter, so it selects the failures among the most recent queries rather than the most recent failures
limitnumberNoMaximum query rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Copy History

List staged-file load results for a table over the last fourteen days.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTable whose load history to return
startTimestringYesISO-8601 start of the load window, within the last fourteen days
endTimestringNoISO-8601 end of the load window, within the last fourteen days; defaults to now
limitnumberNoMaximum load rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Introspect Schema

Inspect table and column metadata through Snowflake INFORMATION_SCHEMA views.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringYesDatabase containing the INFORMATION_SCHEMA views
schemastringNoOptional exact schema name filter
tablestringNoOptional exact table name filter
includeViewsbooleanNoInclude views and materialized views alongside tables

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Call Procedure

Call a stored procedure with explicitly typed Snowflake bindings.

Input

ParameterTypeRequiredDescription
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringYesDatabase name
schemastringYesSchema name
procedureNamestringYesStored procedure name
procedureArgumentsarrayNoOrdered argument bindings with a Snowflake type and string value

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
namestringColumn name
typestringSnowflake data type
lengthnumberColumn length
precisionnumberNumeric precision
scalenumberNumeric scale
nullablebooleanWhether the column is nullable
rowsarrayOne complete Snowflake result partition as string or null arrays
totalRowsnumberTotal result rows
currentPartitionnumberZero-based partition returned
partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
nextPartitionnumberNext partition to request with Get Statement, if one exists
truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
rowsInsertednumberRows inserted by the statement
rowsUpdatednumberRows updated by the statement
rowsDeletednumberRows deleted by the statement
duplicateRowsUpdatednumberDuplicate rows updated by the statement
rowsAffectednumberTotal inserted, updated, and deleted rows

On this page