:doc:`RedshiftDataAPIService <../../redshift-data>` / Client / cancel_statement

****************
cancel_statement
****************



.. py:method:: RedshiftDataAPIService.Client.cancel_statement(**kwargs)

  

  Cancels a running query. To be canceled, a query must be running.

   

  For more information about the Amazon Redshift Data API and CLI usage examples, see `Using the Amazon Redshift Data API <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html>`__ in the *Amazon Redshift Management Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/redshift-data-2019-12-20/CancelStatement>`_  


  **Request Syntax**
  ::

    response = client.cancel_statement(
        Id='string'
    )
    
  :type Id: string
  :param Id: **[REQUIRED]** 

    The identifier of the SQL statement to cancel. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by ``BatchExecuteStatment``, ``ExecuteStatment``, and ``ListStatements``.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Status': True|False
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Status** *(boolean) --* 

        A value that indicates whether the cancel statement succeeded (true).

        
  
  **Exceptions**
  
  *   :py:class:`RedshiftDataAPIService.Client.exceptions.ValidationException`

  
  *   :py:class:`RedshiftDataAPIService.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`RedshiftDataAPIService.Client.exceptions.QueryTimeoutException`

  
  *   :py:class:`RedshiftDataAPIService.Client.exceptions.InternalServerException`

  
  *   :py:class:`RedshiftDataAPIService.Client.exceptions.DatabaseConnectionException`

  