How to create a comment to an oracle database view

試著忘記壹切 提交于 2020-01-14 09:26:12

问题


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?


回答1:


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.';



回答2:


Its possible to create a comment on VIEWs too :

COMMENT ON TABLE view_name ;



回答3:


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 ...';


来源:https://stackoverflow.com/questions/10602148/how-to-create-a-comment-to-an-oracle-database-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!