Home » SQL & PL/SQL » SQL & PL/SQL » How to Unbind undef a variable
How to Unbind undef a variable [message #45754] Mon, 12 April 2004 00:16 Go to next message
sax
Messages: 1
Registered: April 2004
Junior Member
First i declare a variable in sql*plus...that is abind variable..now i want to unbind/undefine the variable. is there any command like "undef <var_name>"
Re: How to Unbind undef a variable [message #45756 is a reply to message #45754] Mon, 12 April 2004 04:55 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9105
Registered: November 2002
Location: California, USA
Senior Member
UNDEFINE variable_name
Re: How to Unbind undef a variable [message #45757 is a reply to message #45754] Mon, 12 April 2004 05:18 Go to previous message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
You can use UNDEFINE on DEFINE variables, but there is no way to remove bind variables. However, you can erase the value by redeclaring the variable.
SQL*Plus: Release 9.2.0.1.0 - Developer's Release

SQL> def somevar = "Some value"
SQL> def somevar
DEFINE SOMEVAR         = "Some value" (CHAR)

SQL> undef somevar
SQL> def somevar
SP2-0135: symbol somevar is UNDEFINED

SQL> var somevar varchar2(20)
SQL> exec :somevar := 'Some value'

PL/SQL procedure successfully completed.

SQL> print somevar

SOMEVAR
--------------------------------
Some value

SQL> var somevar varchar2(20)
SQL> print somevar

SOMEVAR
--------------------------------

Previous Topic: to find the current day
Next Topic: procedure
Goto Forum:
  


Current Time: Sun Apr 13 22:28:56 CDT 2025