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

# CANCEL EXPORT

> CANCEL EXPORT cancels a given data unloading job.

CANCEL EXPORT cancels a given data unloading job. Unloading jobs with the state `CANCELLED` or `FINISHED` cannot be canceled. Canceling an unloading job is an asynchronous process. You can use the [SHOW EXPORT](/documents/4.2/sql-reference/sql-statements/loading_unloading/unloading/SHOW_EXPORT.md) statement to check whether an unloading job is successfully canceled. The unloading job is successfully canceled if the value of `State` is `CANCELLED`.

The CANCEL EXPORT statement requires that you have at least one of the following privileges on the database to which the given unloading job belongs: `SELECT_PRIV`, `LOAD_PRIV`, `ALTER_PRIV`, `CREATE_PRIV`, `DROP_PRIV`, and `USAGE_PRIV`. For more information about privilege descriptions, see [GRANT](/documents/4.2/sql-reference/sql-statements/account-management/GRANT.md).

## Syntax

```SQL theme={null}
CANCEL EXPORT
[FROM db_name]
WHERE QUERYID = "query_id"
```

## Parameters

| **Parameter** | **Required** | **Description** |
| - | - | - |
| db\_name | No | The name of the databases to which the unloading job belongs. If this parameter is not specified, an unloading job in your current database is canceled. |
| query\_id | Yes | The query ID of the unloading job. You can obtain the ID by using the [LAST\_QUERY\_ID()](/documents/4.2/sql-reference/sql-functions/utility-functions/last_query_id.md) function. Note that this function only returns the latest query ID. |

## Examples

Example 1: Cancel an unloading job whose query ID is `921d8f80-7c9d-11eb-9342-acde48001121` in the current database.

```SQL theme={null}
CANCEL EXPORT
WHERE queryid = "921d8f80-7c9d-11eb-9342-acde48001121";
```

Example 2: Cancel an unloading job whose query ID is `921d8f80-7c9d-11eb-9342-acde48001121` in the `example_db` database.

```SQL theme={null}
CANCEL EXPORT 
FROM example_db 
WHERE queryid = "921d8f80-7c9d-11eb-9342-acde48001122";
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.