Variables are persistent across sessions and users. In some cases, best practices dictate that we remove a variable. The DROP and UNSET commands both do this, and function the same way.

Let’s see our current variables:

1 SQL> show variables;

Screen Shot 2016-06-06 at 11.18.25 AM

Use DROP to remove a variable:

1 SQL> drop variable v_period_info;

Screen Shot 2016-06-06 at 11.18.38 AM

Use UNSET to remove a variable:

1 SQL> unset v_period_name;

Screen Shot 2016-06-06 at 11.18.46 AM

Check to make sure those variables are gone:

1 SQL> show variables;

Screen Shot 2016-06-06 at 11.25.50 AM