DROP VARIABLE
Applies to: Databricks SQL Databricks Runtime 14.1 and above
Drops a temporary variable.
Syntax
DROP TEMPORARY VARIABLE [ IF EXISTS ] variable_name
Parameters
-
The name of an existing variable. The variable name may be optionally qualified with
session
orsystem.session
. IF EXISTS
If specified, no exception is thrown when the function does not exist.
Examples
-- Declare and drop a temporary variable
> DECLARE VARIABLE myvar;
> DROP TEMPORARY VARIABLE myvar;
-- A temporary variable can be qualified
> DROP TEMPORARY VARIABLE IF EXISTS session.myvar;