Skip to main content

statements

Creates, updates, deletes, gets or lists a statements resource.

Overview

Namestatements
TypeResource
Idsnowflake.sqlapi.statements

Fields

NameDatatypeDescription
codestring
createdOnintegerTimestamp that specifies when the statement execution started.‌ The timestamp is expressed in milliseconds since the epoch.‌
dataarrayResult set data.
messagestring
resultSetMetaDataobject
sqlStatestring
statementHandlestring
statementStatusUrlstring
statsobjectthese stats might not be available for each request.

Methods

NameAccessible byRequired ParamsDescription
get_statement_statusSELECTUser-Agent, statementHandle, endpointChecks the status of the execution of the statement with the specified statement handle. If the statement was executed successfully, the operation returns the requested partition of the result set.
submit_statementSELECTUser-Agent, endpointSubmits one or more statements for execution. You can specify that the statement should be executed asynchronously.
cancel_statementEXECUser-Agent, statementHandle, endpointCancels the execution of the statement with the specified statement handle.

SELECT examples

Submits one or more statements for execution. You can specify that the statement should be executed asynchronously.

SELECT
code,
createdOn,
data,
message,
resultSetMetaData,
sqlState,
statementHandle,
statementStatusUrl,
stats
FROM snowflake.sqlapi.statements
WHERE User-Agent = '{{ User-Agent }}'
AND endpoint = '{{ endpoint }}';