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?
The single line SQL comment uses two dashes (–) in SQL Server. Once you add the two dashes, SQL Server ignores the text written after these dashes in a single line. It is known as commenting out. You can also see a different color in SQL Server Management Studio (SSMS) after you commented on a piece of code.
You can view the comments on a particular table or column by querying the data dictionary views USER_TAB_COMMENTS , DBA_TAB_COMMENTS , or ALL_TAB_COMMENTS or USER_COL_COMMENTS , DBA_COL_COMMENTS , or ALL_COL_COMMENTS . Specify the name of the operator to be commented.
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.';
Its possible to create a comment on VIEWs too :
COMMENT ON TABLE view_name ;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With