You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| <CopyableCodecode="get_statement_status" /> |`SELECT`| <CopyableCodecode="User-Agent, statementHandle, endpoint" /> | Checks 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. |
47
-
| <CopyableCodecode="submit_statement" /> |`SELECT`| <CopyableCodecode="User-Agent, endpoint" /> | Submits one or more statements for execution. You can specify that the statement should be executed asynchronously. |
48
-
| <CopyableCodecode="cancel_statement" /> |`EXEC`| <CopyableCodecode="User-Agent, statementHandle, endpoint" /> | Cancels the execution of the statement with the specified statement handle. |
47
+
| <CopyableCodecode="submit_statement" /> |`INSERT`| <CopyableCodecode="User-Agent, endpoint" /> | Submits one or more statements for execution. You can specify that the statement should be executed asynchronously. |
48
+
| <CopyableCodecode="cancel_statement" /> |`DELETE`| <CopyableCodecode="User-Agent, statementHandle, endpoint" /> | Cancels the execution of the statement with the specified statement handle. |
Checks 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.
62
55
63
-
Submits one or more statements for execution. You can specify that the statement should be executed asynchronously.
64
56
65
57
```sql
66
58
SELECT
@@ -75,28 +67,145 @@ statementStatusUrl,
75
67
stats
76
68
FROMsnowflake.sqlapi.statements
77
69
WHERE User-Agent ='{{ User-Agent }}'
70
+
AND statementHandle ='{{ statementHandle }}'
78
71
AND endpoint ='{{ endpoint }}';
79
72
```
73
+
## `INSERT` example
74
+
75
+
Use the following StackQL query and manifest file to create a new <code>statements</code> resource.
Checks 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.
116
+
<TabItemvalue="required">
84
117
85
118
```sql
86
-
SELECT
87
-
code,
88
-
createdOn,
89
-
data,
90
-
message,
91
-
resultSetMetaData,
92
-
sqlState,
93
-
statementHandle,
94
-
statementStatusUrl,
95
-
stats
96
-
FROMsnowflake.sqlapi.statements
119
+
/*+ create */
120
+
INSERT INTOsnowflake.sqlapi.statements (
121
+
User-Agent,
122
+
endpoint
123
+
)
124
+
SELECT
125
+
'{{ User-Agent }}',
126
+
'{{ endpoint }}'
127
+
;
128
+
```
129
+
</TabItem>
130
+
131
+
<TabItemvalue="manifest">
132
+
133
+
```yaml
134
+
# Description fields below are for documentation purposes only and are not required in the manifest
135
+
- name: statements
136
+
props:
137
+
- name: User-Agent
138
+
value: string
139
+
description: Required parameter for the statements resource.
140
+
- name: endpoint
141
+
value: string
142
+
description: Required parameter for the statements resource.
143
+
- name: statement
144
+
value: string
145
+
description: >-
146
+
SQL statement or batch of SQL statements to execute. You can specify
147
+
query, DML and DDL statements. The following statements are not
148
+
supported: PUT, GET, USE, ALTER SESSION, BEGIN, COMMIT, ROLLBACK,
149
+
statements that set session variables, and statements that create
150
+
temporary tables and stages.
151
+
- name: timeout
152
+
value: integer
153
+
description: >-
154
+
Timeout in seconds for statement execution. If the execution of a
155
+
statement takes longer than the specified timeout, the execution is
156
+
automatically canceled. To set the timeout to the maximum value (604800
157
+
seconds), set timeout to 0.
158
+
- name: database
159
+
value: string
160
+
description: >-
161
+
Database in which the statement should be executed. The value in this
162
+
field is case-sensitive.
163
+
- name: schema
164
+
value: string
165
+
description: >-
166
+
Schema in which the statement should be executed. The value in this
167
+
field is case-sensitive.
168
+
- name: warehouse
169
+
value: string
170
+
description: >-
171
+
Warehouse to use when executing the statement. The value in this field
172
+
is case-sensitive.
173
+
- name: role
174
+
value: string
175
+
description: >-
176
+
Role to use when executing the statement. The value in this field is
177
+
case-sensitive.
178
+
- name: bindings
179
+
value: {}
180
+
description: >-
181
+
Values of bind variables in the SQL statement. When executing the
182
+
statement, Snowflake replaces placeholders ('?' and ':name') in the
183
+
statement with these specified values.
184
+
- name: parameters
185
+
value:
186
+
timezone: string
187
+
query_tag: string
188
+
binary_output_format: string
189
+
date_output_format: string
190
+
time_output_format: string
191
+
timestamp_output_format: string
192
+
timestamp_ltz_output_format: string
193
+
timestamp_ntz_output_format: string
194
+
timestamp_tz_output_format: string
195
+
multi_statement_count: integer
196
+
description: Session parameters that should be set before executing the statement.
197
+
```
198
+
</TabItem>
199
+
</Tabs>
200
+
201
+
## `DELETE` example
202
+
203
+
Deletes the specified <code>statements</code> resource.
0 commit comments