Comments in Oracle
You can comments to any SQL statements or any schema objects.
A)Comments Within SQL Statements
------------ --------- --------- --------- -
Comments within SQL statements do not affect the statement execution. The only exception is use of hints. With use hints the SQL statements is affected. In fact comment is used to make your application easier for you to read and maintain.
Within SQL statements you can include comment in two ways.
1)With /* and */
------------ --------- -----
Format is,
Begin with slash (/) and an asterisk (*) together (/*) + comment Text + End with an asetrisk (*) and a slash (/) together (*/).
With this format text can span multiple lines.
The opening and terminating characters need not be separated from the text by a space or a line break.
Example:
-----------
SQL> select second_col /*This is column
2 Name */ from test /*This is Table Name*/ ;
2)with --
------------ -----
The text that begin with two hyphens (--) is considered as comments. The comments written in this way can't span multiple lines. End the comment with a line break.
Example:
------------
SQL> select second_col -- THIS IS COMMENT
2 FROM TEST;
B)Comments on Schema Objects
No comments:
Post a Comment