Oracle SQL - Define System Variable

Introduction

You can use the DEFINE system variable as a switch (ON or OFF).

You can change the DEFINE character, if you need the ampersand character (&) without its special meaning.


SQL> select 'Test&Co' as result from dual;
Enter value for co: ASDF

SQL> set define off
SQL> run
  1* select 'Test&Co' as result from dual

SQL> set define !
SQL> select 'Test&Co' as result from !table;
Enter value for table: dual

SQL> set define &
SQL>

You can exit SQL*Plus and start a new session in order to reset all SQL*Plus variables to their default values.

Related Topics