SQL query by rows
POST {{baseUrl}}/api/v2/statements?requestId={{uuid}}&async=false
Submits a single statement for execution. Review the statement under the Body tab under the property statement
. Make sure to also update the database
and warehouse
properties to reflect the database and warehouse that you wish to query.
You can further specify that the statement should be executed asynchronously or synchronously via the boolean query parameter async
under the Params tab.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
requestId | string | Unique ID of the API request. This ensures that the execution is idempotent. If not specified, a new UUID is generated and assigned. | |
async | boolean | Set to true to execute the statement asynchronously and return the statement handle. If the parameter is not specified or is set to false, a statement is executed and the first result is returned if the execution is completed in 45 seconds. If the statement execution takes longer to complete, the statement handle is returned. | |
nullable | string | Set to true to execute the statement to generate the result set including null. If the parameter is set to false, the result set value null will be replaced with a string 'null'. |
Request Body
{"statement"=>"select seq8(), randstr(1000, random()) from table(generator(rowcount=>600))", "timeout"=>"1000", "database"=>"SNOWFLAKE_SAMPLE_DATA", "schema"=>"TPCDS_SF100TCL", "warehouse"=>"COMPUTE_WH"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
User-Agent | string | (Required) Set this to the name and version of your application (e.g. “applicationName/applicationVersion”). You must use a value that complies with RFC 7231. | |
X-Snowflake-Authorization-Token-Type | string | Specify the authorization token type for the Authorization header. KEYPAIR_JWT is for Keypair JWT or OAUTH for oAuth token. If not specified, OAUTH is assumed. | |
Content-Type | string | ||
Accept | string |