Unanswered: comment for column of all tables. ("insufficient privileges")
I have 100's of tables having the common columns like Created_On , Last_Modified_ON , Created_by , Last_Modified_by , Enable_flag , Disable_flag.
I want to Comment for All the tables Having the Similar Column name and Purpose.
My Query as -
set COMMENTS = 'This Stores the Time stamp when the record is created in the System.'
WHERE COLUMN_NAME = 'LT_CREATED_ON';
How to give privileges ??
I have tried -
grant DBA to <Current_User>
but not solved.
To define a comment on a column you have to use the COMMENT ON statement, you cannot use an UPDATE statement for that.
Additionally USER_COL_COMMENTS is a system view that cannot be udpated (and even if you could, it wouldn't work, as the view does not contain a row unless there is a comment, so your UPDATE wouldn't update anything anyway).
You need to generate a script that will contain the necessary SQL statement, something like this:
SELECT 'COMMENT ON COLUMN '||table_name||'.'||column_name||' IS ''This stores the timestamp when the record is created in the system'';'
WHERE column_name = 'LT_CREATED_ON';
Just spool the output of this statement into a SQL script, then run that generated SQL script.
Btw: what's a "plz"? (Sorry, I'm not a native speaker)