Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Comments before Create Materialized View SQL Statement Not Displaying

User_C254NJan 31 2022

Hello,
When I create a Create Materialized View SQL statement, and place a comment before the "Create Materialized View table_name" statement, the comments I entered do not display after the materialized view is created when I view the SQL script in both Oracle SQL Developer and PL/SQL.
But when I enter comments on the same line of the "Select" statement or "Where" clause or somewhere in between "Select" and closing the Select statement with the semicolon " ; ", the comments are displayed when I go and view the code in both Oracle SQL Developer and PL/SQL after the Materialized View is created.
For example, if I enter this comment before the Create Materialized View "OWNER"."MV_NAME" statement:
/* This comment is a test.*/
CREATE MATERIALIZED VIEW "OWNER"."MV_NAME" ("Column_1",........)
The comment /* This comment is a test.*/ does not get displayed in Oracle SQL Developer and PL/SQL. I want to be able to enter a comment before the CREATE MATERIALIZED VIEW begins so that users who are viewing the SQL code will know who created the materialized view, when it was created, the script file name, etc. So I am basically entering a version history in my comments that I want users to see in Oracle SQL Developer and PL/SQL, but the comment is not displaying.
I tried two hyphens (-- This comment is a test) before the CREATE MATERIALIZED VIEW statement too, and that didn't get displayed.
However, if I enter any the comments like this /* This comment is a test.*/ or -- This comment is a test. after the SELECT statement and before ending the SELECT statement with a semicolon (;) the comments will be displayed.
Is there a reason why comments will not be displayed in Oracle SQL Developer and PL/SQL if they are located before the CREATE MATERIALIZED VIEW "OWNER"."MV_NAME" ("Column_1",........) statement?
Thank you.
David

Comments
Post Details
Added on Jan 31 2022
2 comments
484 views