Comments
This document describes the comment syntax supported by MatrixOne.
MatrixOne supports three comment styles:
- Use
#character to comment a line.
1. mysql> select 100-99; # This comment continues to the end of line
2. +----------+
3. | 100 - 99 |
4. +----------+
5. | 1 |
6. +----------+
7. 1 row in set (0.01 sec)
- Use
--to comment a line. The--(double-dash) comment style requires the second dash to be followed by at least one whitespace or control character (such as a space, tab, newline, and so on).
1. mysql> select 100-99; -- This comment continues to the end of line
2. +----------+
3. | 100 - 99 |
4. +----------+
5. | 1 |
6. +----------+
7. 1 row in set (0.01 sec)
- From a
/*sequence to the following*/sequence, as in the C programming language. This syntax enables a comment to extend over multiple lines because the beginning and closing sequences need not be on the same line.
1. mysql> select 100 /* this is an in-line comment */ -99;
2. +----------+
3. | 100 - 99 |
4. +----------+
5. | 1 |
6. +----------+
7. 1 row in set (0.01 sec)
Or:
1. mysql> select 100
2. /*
3. this is an in-line comment
4. */
5. -99;
6. +----------+
7. | 100 - 99 |
8. +----------+
9. | 1 |
10. +----------+
11. 1 row in set (0.01 sec)
MySQL-compatible comment syntax
The same as MySQL, MatrixOne supports a variant of C comment style:
1. mysql> select 100 /*! Specific code */ -99;
2. +----------+
3. | 100 - 99 |
4. +----------+
5. | 1 |
6. +----------+
7. 1 row in set (0.02 sec)
Or:
1. mysql> select 100 /*!50110 Specific code */ -99;
2. +----------+
3. | 100 - 99 |
4. +----------+
5. | 1 |
6. +----------+
7. 1 row in set (0.02 sec)
MatrixOne specific comment syntax
MatrixOne supports a variant of C comment style:
1. mysql> select 100-99; // This comment continues to the end of line
2. +----------+
3. | 100 - 99 |
4. +----------+
5. | 1 |
6. +----------+
7. 1 row in set (0.03 sec)
Or:
1. mysql> // This comment continues to the line
2. -> select 100-99;
3. +----------+
4. | 100 - 99 |
5. +----------+
6. | 1 |
7. +----------+
Constraints
MatrixOne does not support nested comments.
