Sqlplus substitution variables

I didn’t know you could do this. Its quite handy!

SQL> column name new_value dbname
SQL> select name from v$database;
XXX1
SQL> spool test_&dbname
SQL> select sysdate from dual;
03-JUL-06
SQL> spool off
SQL> host dir /od *.lst
03/07/2006 13:16 61 test_XXX1.LST
SQL>

Advertisements