Undefine variable : variable « SQL Plus « Oracle PL / SQL






Undefine variable

    
SQL>
SQL> UNDEFINE user_name
SQL> VARIABLE l_user VARCHAR2(30)
SQL> EXECUTE :l_user := '&user_name';
Enter value for user_name:

PL/SQL procedure successfully completed.

SQL> SELECT 'User ' || :l_user || ' has ' || TO_CHAR(COUNT(*)) || ' tables.'
  2  FROM all_tables
  3  WHERE owner = UPPER(:l_user);
User  has 0 tables.

1 row selected.

SQL>

   
    
    
    
  








Related examples in the same category

1.refcursor varible
2.Save returning value from a function to a variable
3.Define variable and print its value out
4.Define variable and set value
5.Define variable and use it in sql statement
6.Bind variables can be declared in your SQL*Plus script,Preface a bind variable with a colon to reference it in a PL/SQL block
7.Bind variables can even be referenced by SQL queries
8.User defined-variable in update set statement