How to create a comment to an oracle database view
Asked Answered
S

3

9

I would really like to create a comment to a view with a short description of its purpose. Unfortunately it is not possible to create comments to views in oracle. This feature is only for tables, columns and materialized views available. I would like to know how you do describe your database views?

Scrivener answered 15/5, 2012 at 13:48 Comment(0)
E
10

Try:

comment on table <name> is 'text';

The command works on views. For example:

CREATE OR REPLACE VIEW MY_VW AS
  SELECT 1 FROM DUAL;

COMMENT ON TABLE MY_VW IS 'Clever comment.';
Errand answered 15/5, 2012 at 14:2 Comment(0)
S
5

Its possible to create a comment on VIEWs too :

COMMENT ON TABLE view_name ;
Switchman answered 15/5, 2012 at 14:6 Comment(0)
C
1

Simply use :

Comment on table 'view Name' is  ' Comment ...';

If use view in place of SQL , Oracle throws error invalid object category for COMMENT command".

Materialized View : we can simply comment using:

Command on Materialized view "View name" is  'Comment ...';
Comment answered 22/6, 2016 at 6:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.