How to add and Remove Comments on any Column in Oracle


 How to add and Remove Comments on any Column in Oracle 

--===================================================
-- COMMENTS
--===================================================

--DROP  TABLE XX_ADD_COMMENT_TL

desc XX_ADD_COMMENT_TL

CREATE TABLE XX_ADD_COMMENT_TL
(
EMP_NO  NUMBER,
EMP_NAME      VARCHAR2(240 BYTE),
GRADE             VARCHAR2(240 BYTE), /* This is Employee Designation or level */
SAL         NUMBER,                            /* This is Employee Salary*/
CREATION_DATE                DATE             DEFAULT SYSDATE,
LAST_UPDATE_DATE          DATE             DEFAULT SYSDATE,
CREATED_BY                      NUMBER,
LAST_UPDATED_BY             NUMBER,
LAST_UPDATE_LOGIN  NUMBER,
FUTUTE1 VARCHAR2(100),
FUTUTE2 VARCHAR2(100),
FUTUTE3 VARCHAR2(100),
FUTUTE4 VARCHAR2(100),
FUTUTE5 VARCHAR2(100)
)



select * from ALL_COL_COMMENTS  where table_name = 'XX_ADD_COMMENT_TL';

OWNER
TABLE_NAME
COLUMN_NAME
COMMENTS
ORIGIN_CON_ID
APPS
XX_ADD_COMMENT_TL
EMP_NO

0
APPS
XX_ADD_COMMENT_TL
EMP_NAME

0
APPS
XX_ADD_COMMENT_TL
GRADE

0
APPS
XX_ADD_COMMENT_TL
SAL

0
APPS
XX_ADD_COMMENT_TL
CREATION_DATE

0
APPS
XX_ADD_COMMENT_TL
LAST_UPDATE_DATE

0
APPS
XX_ADD_COMMENT_TL
CREATED_BY

0
APPS
XX_ADD_COMMENT_TL
LAST_UPDATED_BY

0
APPS
XX_ADD_COMMENT_TL
LAST_UPDATE_LOGIN

0
APPS
XX_ADD_COMMENT_TL
FUTUTE1

0
APPS
XX_ADD_COMMENT_TL
FUTUTE2

0
APPS
XX_ADD_COMMENT_TL
FUTUTE3

0
APPS
XX_ADD_COMMENT_TL
FUTUTE4

0
APPS
XX_ADD_COMMENT_TL
FUTUTE5

0

--ADD COMMENT --

COMMENT ON COLUMN XX_ADD_COMMENT_TL.FUTUTE1  IS 'Father Name'

COMMENT ON COLUMN XX_ADD_COMMENT_TL.FUTUTE2  IS 'Mother Name'

COMMENT ON COLUMN XX_ADD_COMMENT_TL.FUTUTE3  IS 'Son Name'

COMMENT ON COLUMN XX_ADD_COMMENT_TL.FUTUTE4  IS 'Daughter Name'

COMMENT ON COLUMN XX_ADD_COMMENT_TL.FUTUTE5  IS 'Wife Name'

OWNER
TABLE_NAME
COLUMN_NAME
COMMENTS
ORIGIN_CON_ID
APPS
XX_ADD_COMMENT_TL
EMP_NO

0
APPS
XX_ADD_COMMENT_TL
EMP_NAME

0
APPS
XX_ADD_COMMENT_TL
GRADE

0
APPS
XX_ADD_COMMENT_TL
SAL

0
APPS
XX_ADD_COMMENT_TL
CREATION_DATE

0
APPS
XX_ADD_COMMENT_TL
LAST_UPDATE_DATE

0
APPS
XX_ADD_COMMENT_TL
CREATED_BY

0
APPS
XX_ADD_COMMENT_TL
LAST_UPDATED_BY

0
APPS
XX_ADD_COMMENT_TL
LAST_UPDATE_LOGIN

0
APPS
XX_ADD_COMMENT_TL
FUTUTE1
Father Name
0
APPS
XX_ADD_COMMENT_TL
FUTUTE2
Mother Name
0
APPS
XX_ADD_COMMENT_TL
FUTUTE3
Son Name
0
APPS
XX_ADD_COMMENT_TL
FUTUTE4
Daughter Name
0
APPS
XX_ADD_COMMENT_TL
FUTUTE5
Wife Name
0

--Create View --

create or replace view XX_ADD_COMMENT_V AS
select EMP_NO, SAL, GRADE from XX_ADD_COMMENT_TL

select * from XX_ADD_COMMENT_V


select * from all_col_comments  where table_name = 'XX_ADD_COMMENT_V';

OWNER
TABLE_NAME
COLUMN_NAME
COMMENTS
ORIGIN_CON_ID
APPS
XX_ADD_COMMENT_V
EMP_NO

0
APPS
XX_ADD_COMMENT_V
SAL

0
APPS
XX_ADD_COMMENT_V
GRADE

0

--Add Comment on View --

COMMENT ON COLUMN XX_ADD_COMMENT_V.EMP_NO  IS ' Employee ID'

COMMENT ON COLUMN XX_ADD_COMMENT_V.SAL  IS ' Employee Income'

COMMENT ON COLUMN XX_ADD_COMMENT_V.GRADE  IS ' Employee Designation'


OWNER
TABLE_NAME
COLUMN_NAME
COMMENTS
ORIGIN_CON_ID
APPS
XX_ADD_COMMENT_V
EMP_NO
Employee number
0
APPS
XX_ADD_COMMENT_V
SAL
Salary
0
APPS
XX_ADD_COMMENT_V
GRADE
 Employee Designation
0


select * from all_col_comments  where table_name = 'XX_ADD_COMMENT_V';
-- DROP Comment --


select * from ALL_COL_COMMENTS  where table_name = 'XX_ADD_COMMENT_TL';

COMMENT ON COLUMN XX_ADD_COMMENT_TL.FUTUTE5  IS ''

OWNER
TABLE_NAME
COLUMN_NAME
COMMENTS
ORIGIN_CON_ID
APPS
XX_ADD_COMMENT_TL
EMP_NO

0
APPS
XX_ADD_COMMENT_TL
EMP_NAME

0
APPS
XX_ADD_COMMENT_TL
GRADE

0
APPS
XX_ADD_COMMENT_TL
SAL

0
APPS
XX_ADD_COMMENT_TL
CREATION_DATE

0
APPS
XX_ADD_COMMENT_TL
LAST_UPDATE_DATE

0
APPS
XX_ADD_COMMENT_TL
CREATED_BY

0
APPS
XX_ADD_COMMENT_TL
LAST_UPDATED_BY

0
APPS
XX_ADD_COMMENT_TL
LAST_UPDATE_LOGIN

0
APPS
XX_ADD_COMMENT_TL
FUTUTE1
Father Name
0
APPS
XX_ADD_COMMENT_TL
FUTUTE2
Mother Name
0
APPS
XX_ADD_COMMENT_TL
FUTUTE3
Son Name
0
APPS
XX_ADD_COMMENT_TL
FUTUTE4
Daughter Name
0
APPS
XX_ADD_COMMENT_TL
FUTUTE5

0




Comments

Popular posts from this blog

E-Text Report In Fusion | Types of E-Text reports

Supplier API's

How to pass default Parameter in cursor