Some words in the Oracle database are reserved for specific use or fully. In this way, it is intended to eliminate possible typographical errors in SQL statements.
You can find out what the reserved words are and whether they are reserved for a specific purpose or completely reserved, from the V$RESERVED_WORDS view.
For example, the word TABLE is a reserved word. We cannot use this word in information such as table name or column name. If used, we will receive errors as follows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
SQL> create table TABLE ( 2 name varchar(100), 3 surname varchar(100), 4 phone number(5) ); create table TABLE * ERROR at line 1: ORA-00903: invalid table name SQL> create table a ( table varchar(100), size number(2)); table varchar(100), * ERROR at line 2: ORA-00904: : invalid identifier |
But if we need to use it, there is also a method. It is possible to use reserved words in double quotes.
As in the following examples, we can use reserved words in object names.
1 2 3 4 5 6 7 8 9 10 11 12 |
SQL> create table "TABLE" ( name varchar(100), surname varchar(100), phone number(5)); 2 3 4 Table created. SQL> create table a ( "table" varchar(100), size number(2)); 2 3 Table created. |