| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 4 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 5 |
<link href="sqlite.css" rel="stylesheet"> |
| 6 |
<title>SQL Comment Syntax</title> |
| 7 |
<!-- path= --> |
| 8 |
</head> |
| 9 |
<body> |
| 10 |
<div class=nosearch> |
| 11 |
<a href="index.html"> |
| 12 |
<img class="logo" src="images/sqlite370_banner.svg" alt="SQLite" border="0"> |
| 13 |
</a> |
| 14 |
<div><!-- IE hack to prevent disappearing logo --></div> |
| 15 |
<div class="tagline desktoponly"> |
| 16 |
Small. Fast. Reliable.<br>Choose any three. |
| 17 |
</div> |
| 18 |
<div class="menu mainmenu"> |
| 19 |
<ul> |
| 20 |
<li><a href="index.html">Home</a> |
| 21 |
<li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a> |
| 22 |
<li class='wideonly'><a href='about.html'>About</a> |
| 23 |
<li class='desktoponly'><a href="docs.html">Documentation</a> |
| 24 |
<li class='desktoponly'><a href="download.html">Download</a> |
| 25 |
<li class='wideonly'><a href='copyright.html'>License</a> |
| 26 |
<li class='desktoponly'><a href="support.html">Support</a> |
| 27 |
<li class='desktoponly'><a href="prosupport.html">Purchase</a> |
| 28 |
<li class='search' id='search_menubutton'> |
| 29 |
<a href="javascript:void(0)" onclick='toggle_search()'>Search</a> |
| 30 |
</ul> |
| 31 |
</div> |
| 32 |
<div class="menu submenu" id="submenu"> |
| 33 |
<ul> |
| 34 |
<li><a href='about.html'>About</a> |
| 35 |
<li><a href='docs.html'>Documentation</a> |
| 36 |
<li><a href='download.html'>Download</a> |
| 37 |
<li><a href='support.html'>Support</a> |
| 38 |
<li><a href='prosupport.html'>Purchase</a> |
| 39 |
</ul> |
| 40 |
</div> |
| 41 |
<div class="searchmenu" id="searchmenu"> |
| 42 |
<form method="GET" action="search"> |
| 43 |
<select name="s" id="searchtype"> |
| 44 |
<option value="d">Search Documentation</option> |
| 45 |
<option value="c">Search Changelog</option> |
| 46 |
</select> |
| 47 |
<input type="text" name="q" id="searchbox" value=""> |
| 48 |
<input type="submit" value="Go"> |
| 49 |
</form> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
<script> |
| 53 |
function toggle_div(nm) { |
| 54 |
var w = document.getElementById(nm); |
| 55 |
if( w.style.display=="block" ){ |
| 56 |
w.style.display = "none"; |
| 57 |
}else{ |
| 58 |
w.style.display = "block"; |
| 59 |
} |
| 60 |
} |
| 61 |
function toggle_search() { |
| 62 |
var w = document.getElementById("searchmenu"); |
| 63 |
if( w.style.display=="block" ){ |
| 64 |
w.style.display = "none"; |
| 65 |
} else { |
| 66 |
w.style.display = "block"; |
| 67 |
setTimeout(function(){ |
| 68 |
document.getElementById("searchbox").focus() |
| 69 |
}, 30); |
| 70 |
} |
| 71 |
} |
| 72 |
function div_off(nm){document.getElementById(nm).style.display="none";} |
| 73 |
window.onbeforeunload = function(e){div_off("submenu");} |
| 74 |
/* Disable the Search feature if we are not operating from CGI, since */ |
| 75 |
/* Search is accomplished using CGI and will not work without it. */ |
| 76 |
if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){ |
| 77 |
document.getElementById("search_menubutton").style.display = "none"; |
| 78 |
} |
| 79 |
/* Used by the Hide/Show button beside syntax diagrams, to toggle the */ |
| 80 |
function hideorshow(btn,obj){ |
| 81 |
var x = document.getElementById(obj); |
| 82 |
var b = document.getElementById(btn); |
| 83 |
if( x.style.display!='none' ){ |
| 84 |
x.style.display = 'none'; |
| 85 |
b.innerHTML='show'; |
| 86 |
}else{ |
| 87 |
x.style.display = ''; |
| 88 |
b.innerHTML='hide'; |
| 89 |
} |
| 90 |
return false; |
| 91 |
} |
| 92 |
var antiRobot = 0; |
| 93 |
function antiRobotGo(){ |
| 94 |
if( antiRobot!=3 ) return; |
| 95 |
antiRobot = 7; |
| 96 |
var j = document.getElementById("mtimelink"); |
| 97 |
if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href"); |
| 98 |
} |
| 99 |
function antiRobotDefense(){ |
| 100 |
document.body.onmousedown=function(){ |
| 101 |
antiRobot |= 2; |
| 102 |
antiRobotGo(); |
| 103 |
document.body.onmousedown=null; |
| 104 |
} |
| 105 |
document.body.onmousemove=function(){ |
| 106 |
antiRobot |= 2; |
| 107 |
antiRobotGo(); |
| 108 |
document.body.onmousemove=null; |
| 109 |
} |
| 110 |
setTimeout(function(){ |
| 111 |
antiRobot |= 1; |
| 112 |
antiRobotGo(); |
| 113 |
}, 100) |
| 114 |
antiRobotGo(); |
| 115 |
} |
| 116 |
antiRobotDefense(); |
| 117 |
</script> |
| 118 |
<div class=fancy> |
| 119 |
<div class=nosearch> |
| 120 |
<div class="fancy_title"> |
| 121 |
SQL Comment Syntax |
| 122 |
</div> |
| 123 |
</div> |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
<p><b><a href="syntax/comment-syntax.html">comment-syntax:</a></b> |
| 130 |
<button id='x49aaee40' onclick='hideorshow("x49aaee40","xf6f99226")'>hide</button></p> |
| 131 |
<div id='xf6f99226' class='imgcontainer'> |
| 132 |
<div style="max-width:661px"><svg xmlns='http://www.w3.org/2000/svg' style='font-size:initial;' class="pikchr" viewBox="0 0 661.704 147.96" data-pikchr-date="20250319161943"> |
| 133 |
<circle cx="5.76" cy="17.28" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 134 |
<polygon points="32.4,17.28 20.88,21.6 20.88,12.96" style="fill:rgb(0,0,0)"/> |
| 135 |
<path d="M9.36,17.28L26.64,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 136 |
<polygon points="68.4,17.28 56.88,21.6 56.88,12.96" style="fill:rgb(0,0,0)"/> |
| 137 |
<path d="M32.4,17.28L62.64,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 138 |
<path d="M83.52,32.4A15.12 15.12 0 0 0 98.64 17.28A15.12 15.12 0 0 0 83.52 2.16A15.12 15.12 0 0 0 68.4 17.28A15.12 15.12 0 0 0 83.52 32.4Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 139 |
<text x="83.52" y="17.28" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">--</text> |
| 140 |
<polygon points="121.68,17.28 110.16,21.6 110.16,12.96" style="fill:rgb(0,0,0)"/> |
| 141 |
<path d="M98.64,17.28L115.92,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 142 |
<path d="M172.8,70.2L359.827,70.2A15.12 15.12 0 0 0 374.947 55.08L374.947,55.08A15.12 15.12 0 0 0 359.827 39.96L172.8,39.96A15.12 15.12 0 0 0 157.68 55.08L157.68,55.08A15.12 15.12 0 0 0 172.8 70.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 143 |
<text x="266.314" y="55.08" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">anything-except-newline</text> |
| 144 |
<polygon points="347.789,17.28 336.269,21.6 336.269,12.96" style="fill:rgb(0,0,0)"/> |
| 145 |
<path d="M121.68,17.28L342.029,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 146 |
<polygon points="374.947,55.08 386.467,50.76 386.467,59.4" style="fill:rgb(0,0,0)"/> |
| 147 |
<path d="M347.789,17.28 L 382.987,17.28 Q 397.987,17.28 397.987,32.28 L 397.987,40.08 Q 397.987,55.08 389.347,55.08 L 380.707,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 148 |
<polygon points="194.64,17.28 183.12,21.6 183.12,12.96" style="fill:rgb(0,0,0)"/> |
| 149 |
<path d="M157.68,55.08 L 146.16,55.08 Q 134.64,55.08 134.64,40.08 L 134.64,32.28 Q 134.64,17.28 149.64,17.28 L 173.88,17.28 L 188.88,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 150 |
<polygon points="464.947,17.28 453.427,21.6 453.427,12.96" style="fill:rgb(0,0,0)"/> |
| 151 |
<path d="M374.947,17.28L459.187,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 152 |
<path d="M480.067,32.4L527.011,32.4A15.12 15.12 0 0 0 542.131 17.28A15.12 15.12 0 0 0 527.011 2.16L480.067,2.16A15.12 15.12 0 0 0 464.947 17.28A15.12 15.12 0 0 0 480.067 32.4Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 153 |
<text x="503.539" y="17.28" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">newline</text> |
| 154 |
<path d="M480.067,70.2L563.184,70.2A15.12 15.12 0 0 0 578.304 55.08L578.304,55.08A15.12 15.12 0 0 0 563.184 39.96L480.067,39.96A15.12 15.12 0 0 0 464.947 55.08L464.947,55.08A15.12 15.12 0 0 0 480.067 70.2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 155 |
<text x="521.626" y="55.08" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">end-of-input</text> |
| 156 |
<polygon points="601.344,55.08 589.824,59.4 589.824,50.76" style="fill:rgb(0,0,0)"/> |
| 157 |
<path d="M578.304,55.08L595.584,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 158 |
<polygon points="652.344,17.28 640.824,21.6 640.824,12.96" style="fill:rgb(0,0,0)"/> |
| 159 |
<path d="M601.344,55.08 L 608.844,55.08 Q 616.344,55.08 616.344,40.08 L 616.344,32.28 Q 616.344,17.28 631.344,17.28 L 631.584,17.28 L 646.584,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 160 |
<circle cx="655.944" cy="17.28" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 161 |
<path d="M542.131,17.28L632.904,17.28" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 162 |
<polygon points="464.947,55.08 453.427,59.4 453.427,50.76" style="fill:rgb(0,0,0)"/> |
| 163 |
<path d="M374.947,17.28 L 412.447,17.28 Q 427.447,17.28 427.447,32.28 L 427.447,40.08 Q 427.447,55.08 442.447,55.08 L 444.187,55.08 L 459.187,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 164 |
<path d="M83.52,108A15.12 15.12 0 0 0 98.64 92.88A15.12 15.12 0 0 0 83.52 77.76A15.12 15.12 0 0 0 68.4 92.88A15.12 15.12 0 0 0 83.52 108Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 165 |
<text x="83.52" y="92.88" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">/*</text> |
| 166 |
<polygon points="68.4,92.88 56.88,97.2 56.88,88.56" style="fill:rgb(0,0,0)"/> |
| 167 |
<path d="M32.4,17.28 L 39.9,17.28 Q 47.4,17.28 47.4,32.28 L 47.4,77.88 Q 47.4,92.88 55.02,92.88 L 62.64,92.88" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 168 |
<polygon points="121.68,92.88 110.16,97.2 110.16,88.56" style="fill:rgb(0,0,0)"/> |
| 169 |
<path d="M98.64,92.88L115.92,92.88" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 170 |
<path d="M121.68,92.88L193.68,92.88" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 171 |
<path d="M172.8,145.8L308.102,145.8A15.12 15.12 0 0 0 323.222 130.68A15.12 15.12 0 0 0 308.102 115.56L172.8,115.56A15.12 15.12 0 0 0 157.68 130.68A15.12 15.12 0 0 0 172.8 145.8Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 172 |
<text x="240.451" y="130.68" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">anything-except-*/</text> |
| 173 |
<path d="M480.067,108A15.12 15.12 0 0 0 495.187 92.88A15.12 15.12 0 0 0 480.067 77.76A15.12 15.12 0 0 0 464.947 92.88A15.12 15.12 0 0 0 480.067 108Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 174 |
<text x="480.067" y="92.88" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">*/</text> |
| 175 |
<polygon points="323.222,130.68 334.742,126.36 334.742,135" style="fill:rgb(0,0,0)"/> |
| 176 |
<path d="M323.222,92.88 L 334.742,92.88 Q 346.262,92.88 346.262,107.88 L 346.262,115.68 Q 346.262,130.68 337.622,130.68 L 328.982,130.68" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 177 |
<polygon points="464.947,92.88 453.427,97.2 453.427,88.56" style="fill:rgb(0,0,0)"/> |
| 178 |
<path d="M157.68,130.68 L 146.16,130.68 Q 134.64,130.68 134.64,115.68 L 134.64,107.88 Q 134.64,92.88 149.64,92.88 L 444.187,92.88 L 459.187,92.88" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 179 |
<polygon points="601.344,92.88 589.824,97.2 589.824,88.56" style="fill:rgb(0,0,0)"/> |
| 180 |
<path d="M495.187,92.88L595.584,92.88" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 181 |
<path d="M601.344,92.88 L 608.844,92.88 Q 616.344,92.88 616.344,77.88 L 616.344,54.96 L 616.344,39.96" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 182 |
<path d="M412.447,92.88 L 419.947,92.88 Q 427.447,92.88 427.447,77.88 L 427.447,70.08 Q 427.447,55.08 440.437,55.08 L 453.427,55.08" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 183 |
</svg> |
| 184 |
</div> |
| 185 |
</div> |
| 186 |
|
| 187 |
|
| 188 |
<p>Comments are not SQL commands, but can occur within the text of |
| 189 |
SQL queries passed to <a href="c3ref/prepare.html">sqlite3_prepare_v2()</a> and related interfaces. |
| 190 |
Comments are treated as whitespace by the parser. |
| 191 |
Comments can begin anywhere whitespace |
| 192 |
can be found, including inside expressions that span multiple lines. |
| 193 |
</p> |
| 194 |
|
| 195 |
<p>SQL comments begin with two consecutive "-" characters (ASCII 0x2d) |
| 196 |
and extend up to and including the next newline character (ASCII 0x0a) |
| 197 |
or until the end of input, whichever comes first.</p> |
| 198 |
|
| 199 |
<p>C-style comments begin |
| 200 |
with "/*" and extend up to and including the next "*/" character pair |
| 201 |
or until the end of input, whichever comes first. C-style comments |
| 202 |
can span multiple lines. </p> |
| 203 |
|
| 204 |
<p>Comments can appear anywhere whitespace can occur, |
| 205 |
including inside expressions and in the middle of other SQL statements. |
| 206 |
Comments do not nest. |
| 207 |
</p> |
| 208 |
<p align="center"><small><i>This page was last updated on 2022-01-08 05:02:57Z </small></i></p> |
| 209 |
|