Skip to content

Comments

View as Markdown

CoraDB ignores comments when it runs a statement. Three styles are available, and they can be mixed in one statement:

Style Syntax Extends
SQL -- comment To the end of the line
C++ // comment To the end of the line
C /* comment */ To the closing */, across lines if needed
SELECT name -- SQL-style comment
FROM countries // C++-style comment
WHERE /* C-style comment */ code = 'FRA';
name
France

A C-style comment can span several lines:

/* Countries we ship to.
Codes follow ISO 3166-1 alpha-3. */
SELECT code, name FROM countries;

C-style comments do not nest: the first */ ends the comment, whatever /* appeared before it.

A C-style comment that starts with a plus sign, /*+ ... */, is not ignored: it holds optimizer hints for the statement, such as USE_IDX or ORDERED. Write ordinary comments without the +.

SELECT /*+ RECOMPILE */ COUNT(*) FROM orders WHERE order_date >= DATE'2025-12-01';