Syntax
Parameters
Parameter | Description |
---|---|
<location_name> | The identifier of the location to remove. |
IF EXISTS | A parameter that suppresses the error if the location doesn’t exist. |
WITH FORCE | Forces the removal of the location even if it has dependent external tables. Warning: This option invalidates all dependent external tables. |
Examples
Drop a location The following code example removes aLOCATION
object from your Firebolt account:
LOCATION
object from your Firebolt account if it exists:
- Safe Approach: Drop all dependent external tables before dropping the location.
- Force Approach: Use the
WITH FORCE
option to drop the location immediately regardless of dependencies.
WITH FORCE
, the following apply:
- The location is deleted regardless of existing dependencies.
- All external tables that reference the removed location become invalid.
- Queries on any invalid tables will result in an error.
- You must manually clean up the invalid external tables after using
WITH FORCE
.
LOCATION
object from your Firebolt account without considering its dependencies:
Error handling
The following table lists the types of errors that may occur during location removal:Error Type | Cause | Resolution |
---|---|---|
Location Not Found or Unauthorized | The specified location does not exist or you lack permission to access it. | Use IF EXISTS to handle non-existent locations without error. |
Dependent Objects Exist | The location is referenced by one or more external tables. | Drop the dependent tables first or use WITH FORCE to bypass dependency checks. |
Invalid External Table | Attempting to query an external table after its location was removed using WITH FORCE . | Drop the invalid external table. |
Best Practices
When dropping a location, consider the following:- Before Dropping
- Use
IF EXISTS
to handle non-existent locations gracefully. - Ensure no active queries are using the location.
- Check for dependent external tables.
- Use
-
Using WITH FORCE
- Use only when necessary.
- Clean up invalid external tables immediately.
- Document the reason for using this option.
-
After Dropping
- Verify all dependent objects are handled.
- Update any scripts or documentation referencing the location.
Notes
- All identifiers are case-insensitive unless enclosed in double-quotes
- For more information about object identifiers, see Object identifiers