Use -- to comment a line. The second dash must be followed by a space, tab, newline, carriage return, or the end of the input.
mysql>select100-99;-- This comment continues to the end of line+----------+|100-99|+----------+|1|+----------+1rowinset(0.01sec)
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.
mysql>select100/* this is an in-line comment */-99;+----------+|100-99|+----------+|1|+----------+1rowinset(0.01sec)
Or:
mysql>select100/*this is an in-line comment*/-99;+----------+|100-99|+----------+|1|+----------+1rowinset(0.01sec)
MatrixOne supports executable comments of the form /*!SQL*/ and /*!versionSQL*/: valid SQL inside them is parsed. The following examples fail because Specificcode is not valid SQL at that position, rather than because executable comments are unsupported:
mysql>select100/*! Specific code */-99;ERROR1064(HY000):SQLparsererror:YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMatrixOneserverversionfortherightsyntaxtouse.syntaxerroratline1column28near" code */ -99";
Or:
mysql>select100/*!50110 Specific code */-99;ERROR1064(HY000):SQLparsererror:YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMatrixOneserverversionfortherightsyntaxtouse.syntaxerroratline1column33near" code */ -99";
Comments¶
This document describes the comment syntax supported by MatrixOne.
MatrixOne supports three comment styles:
Use
#character to comment a line.Use
--to comment a line. The second dash must be followed by a space, tab, newline, carriage return, or the end of the input.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.Or:
MatrixOne specific comment syntax¶
MatrixOne supports C comment style as below:
Or:
MatrixOne supports executable comments of the form
/*! SQL */and/*!version SQL */: valid SQL inside them is parsed. The following examples fail becauseSpecific codeis not valid SQL at that position, rather than because executable comments are unsupported:Or:
Constraints¶
MatrixOne does not support nested comments.