> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinkfish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# snowflake-cloud-sql

> Snowflake SQL Execution

**Server path:** `/snowflake-cloud-sql` | **Type:** Application | **PCID required:** Yes

## Tools

| Tool                                                                                    | Description                                       |
| --------------------------------------------------------------------------------------- | ------------------------------------------------- |
| [`snowflake_cloud_sql_cancel_statement`](#snowflake_cloud_sql_cancel_statement)         | Cancels the execution of a statement.             |
| [`snowflake_cloud_sql_get_statement_status`](#snowflake_cloud_sql_get_statement_status) | Checks the status of the execution of a statement |
| [`snowflake_cloud_sql_submit_statement`](#snowflake_cloud_sql_submit_statement)         | Submits a SQL statement for execution.            |

***

## snowflake\_cloud\_sql\_cancel\_statement

Cancels the execution of a statement.

**Parameters:**

| Parameter                              | Type   | Required | Default | Description                                                                                                                                                      |
| -------------------------------------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `statementHandle`                      | string | Yes      | —       | The handle of the statement that you want to use (e.g. to fetch the result set or cancel execution).                                                             |
| `requestId`                            | string | No       | —       | Unique ID of the API request. This ensures that the execution is idempotent. If not specified, a new UUID is generated and assigned.                             |
| `Accept`                               | string | No       | —       | The response payload format. The schema should be specified in resultSetMetaData in the request payload.                                                         |
| `User-Agent`                           | string | Yes      | —       | 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 | No       | —       | 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. |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for the authenticated connection"
      },
      "statementHandle": {
        "type": "string",
        "description": "The handle of the statement that you want to use (e.g. to fetch the result set or cancel execution)."
      },
      "requestId": {
        "type": "string",
        "description": "Unique ID of the API request. This ensures that the execution is idempotent. If not specified, a new UUID is generated and assigned."
      },
      "Accept": {
        "type": "string",
        "description": "The response payload format. The schema should be specified in resultSetMetaData in the request payload."
      },
      "User-Agent": {
        "type": "string",
        "description": "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": {
        "type": "string",
        "description": "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."
      }
    },
    "required": [
      "PCID",
      "statementHandle",
      "User-Agent"
    ]
  }
  ```
</Expandable>

***

## snowflake\_cloud\_sql\_get\_statement\_status

Checks the status of the execution of a statement

**Parameters:**

| Parameter                              | Type    | Required | Default | Description                                                                                                                                                      |
| -------------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `statementHandle`                      | string  | Yes      | —       | The handle of the statement that you want to use (e.g. to fetch the result set or cancel execution).                                                             |
| `requestId`                            | string  | No       | —       | Unique ID of the API request. This ensures that the execution is idempotent. If not specified, a new UUID is generated and assigned.                             |
| `partition`                            | integer | No       | —       | Number of the partition of results to return. The number can range from 0 to the total number of partitions minus 1.                                             |
| `Accept`                               | string  | No       | —       | The response payload format. The schema should be specified in resultSetMetaData in the request payload.                                                         |
| `User-Agent`                           | string  | Yes      | —       | 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  | No       | —       | 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. |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for the authenticated connection"
      },
      "statementHandle": {
        "type": "string",
        "description": "The handle of the statement that you want to use (e.g. to fetch the result set or cancel execution)."
      },
      "requestId": {
        "type": "string",
        "description": "Unique ID of the API request. This ensures that the execution is idempotent. If not specified, a new UUID is generated and assigned."
      },
      "partition": {
        "type": "integer",
        "description": "Number of the partition of results to return. The number can range from 0 to the total number of partitions minus 1."
      },
      "Accept": {
        "type": "string",
        "description": "The response payload format. The schema should be specified in resultSetMetaData in the request payload."
      },
      "User-Agent": {
        "type": "string",
        "description": "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": {
        "type": "string",
        "description": "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."
      }
    },
    "required": [
      "PCID",
      "statementHandle",
      "User-Agent"
    ]
  }
  ```
</Expandable>

***

## snowflake\_cloud\_sql\_submit\_statement

Submits a SQL statement for execution.

**Parameters:**

| Parameter                              | Type    | Required | Default | Description                                                                                                                                                                                                                                                                                                                             |
| -------------------------------------- | ------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `requestId`                            | string  | No       | —       | 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 | No       | —       | 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`                             | boolean | No       | —       | 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'.                                                                                                                                                      |
| `Accept`                               | string  | No       | —       | The response payload format. The schema should be specified in resultSetMetaData in the request payload.                                                                                                                                                                                                                                |
| `User-Agent`                           | string  | Yes      | —       | 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  | No       | —       | 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.                                                                                                                                                                        |
| `bindings`                             | object  | No       | —       | Values of bind variables in the SQL statement. When executing the statement, Snowflake replaces placeholders ('?' and ':name') in the statement with these specified values.                                                                                                                                                            |
| `database`                             | string  | No       | —       | Database in which the statement should be executed. The value in this field is case-sensitive.                                                                                                                                                                                                                                          |
| `parameters`                           | object  | No       | —       | Session parameters that should be set before executing the statement.                                                                                                                                                                                                                                                                   |
| `role`                                 | string  | No       | —       | Role to use when executing the statement. The value in this field is case-sensitive.                                                                                                                                                                                                                                                    |
| `schema`                               | string  | No       | —       | Schema in which the statement should be executed. The value in this field is case-sensitive.                                                                                                                                                                                                                                            |
| `statement`                            | string  | Yes      | —       | SQL statement or batch of SQL statements to execute. You can specify query, DML and DDL statements. The following statements are not supported: PUT, GET, USE, ALTER SESSION, BEGIN, COMMIT, ROLLBACK, statements that set session variables, and statements that create temporary tables and stages.                                   |
| `timeout`                              | integer | No       | —       | Timeout in seconds for statement execution. If the execution of a statement takes longer than the specified timeout, the execution is automatically canceled. To set the timeout to the maximum value (604800 seconds), set timeout to 0.                                                                                               |
| `warehouse`                            | string  | No       | —       | Warehouse to use when executing the statement. The value in this field is case-sensitive.                                                                                                                                                                                                                                               |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for the authenticated connection"
      },
      "requestId": {
        "type": "string",
        "description": "Unique ID of the API request. This ensures that the execution is idempotent. If not specified, a new UUID is generated and assigned."
      },
      "async": {
        "type": "boolean",
        "description": "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": {
        "type": "boolean",
        "description": "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'."
      },
      "Accept": {
        "type": "string",
        "description": "The response payload format. The schema should be specified in resultSetMetaData in the request payload."
      },
      "User-Agent": {
        "type": "string",
        "description": "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": {
        "type": "string",
        "description": "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."
      },
      "bindings": {
        "type": "object",
        "description": "Values of bind variables in the SQL statement. When executing the statement, Snowflake replaces placeholders ('?' and ':name') in the statement with these specified values."
      },
      "database": {
        "type": "string",
        "description": "Database in which the statement should be executed. The value in this field is case-sensitive."
      },
      "parameters": {
        "type": "object",
        "description": "Session parameters that should be set before executing the statement.",
        "properties": {
          "timezone": {
            "type": "string",
            "description": "Time zone to use when executing the statement."
          },
          "query_tag": {
            "type": "string",
            "description": "Query tag that you want to associate with the SQL statement."
          },
          "binary_output_format": {
            "type": "string",
            "description": "Output format for binary values."
          },
          "date_output_format": {
            "type": "string",
            "description": "Output format for DATE values."
          },
          "time_output_format": {
            "type": "string",
            "description": "Output format for TIME values."
          },
          "timestamp_output_format": {
            "type": "string",
            "description": "Output format for TIMESTAMP values."
          },
          "timestamp_ltz_output_format": {
            "type": "string",
            "description": "Output format for TIMESTAMP_LTZ values."
          },
          "timestamp_ntz_output_format": {
            "type": "string",
            "description": "Output format for TIMESTAMP_NTZ values."
          },
          "timestamp_tz_output_format": {
            "type": "string",
            "description": "Output format for TIMESTAMP_TZ values."
          },
          "multi_statement_count": {
            "type": "integer",
            "description": "Number of statements to execute when using multi-statement capability. 0 implies variable number of statements. Negative numbers are not allowed."
          }
        }
      },
      "role": {
        "type": "string",
        "description": "Role to use when executing the statement. The value in this field is case-sensitive."
      },
      "schema": {
        "type": "string",
        "description": "Schema in which the statement should be executed. The value in this field is case-sensitive."
      },
      "statement": {
        "type": "string",
        "description": "SQL statement or batch of SQL statements to execute. You can specify query, DML and DDL statements. The following statements are not supported: PUT, GET, USE, ALTER SESSION, BEGIN, COMMIT, ROLLBACK, statements that set session variables, and statements that create temporary tables and stages."
      },
      "timeout": {
        "type": "integer",
        "description": "Timeout in seconds for statement execution. If the execution of a statement takes longer than the specified timeout, the execution is automatically canceled. To set the timeout to the maximum value (604800 seconds), set timeout to 0."
      },
      "warehouse": {
        "type": "string",
        "description": "Warehouse to use when executing the statement. The value in this field is case-sensitive."
      }
    },
    "required": [
      "PCID",
      "User-Agent",
      "statement"
    ]
  }
  ```
</Expandable>
