Monday, 9 January 2017

Adding a Comment to a Table/Column


You add a comment table or column using the COMMENT statement. The following example adds a comment to the employee table:


CREATE TABLE EMP (EMPNO NUMBER(4) NOT NULL,
                  ENAME VARCHAR2(10),
                  JOB VARCHAR2(9),
                  SAL NUMBER(7, 2),
                  HIREDATE DATE,
                  DEPTNO NUMBER(2));



SQL>
SQL> COMMENT ON TABLE EMP IS
  2  'employee stores the information of employees';

Comment created.

SQL>
SQL>
The next example adds a comment to the emp.ename column:


SQL> COMMENT ON COLUMN emp.ename IS
  2  'ename stores the employee name';

Comment created.

SQL>