<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
<title>CREATE VIRTUAL TABLE</title>
<link rel="stylesheet" type="text/css" href="ndoc.css" />
</head>
<body>
<div id="header">
<table width="100%" id="topTable">
<tr id="headerTableRow1">
<td align="left">
<span id="runningHeaderText">CREATE VIRTUAL TABLE</span> </td>
</tr>
<tr id="headerTableRow2">
<td align="left">
<span id="nsrTitle">SQLite Language Reference Documentation</span>
</td>
</tr>
<tr id="headerTableRow3" style="display:none">
<td>
<a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
<a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
</td>
</tr>
</table>
<table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
<tr>
<td>
<span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
<img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
<label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
Collapse All
</label>
<label id="expandAllLabel" for="toggleAllImage" style="display: none;">
Expand All
</label>
</span>
</td>
</tr>
</table>
</div>
<div id="mainSection">
<div id="mainBody">
<h1 class="heading">
SQL As Understood By SQLite</h1>
<h4>
CREATE VIRTUAL TABLE</h4>
<p>
<table cellpadding="10">
<tr>
<td align="right" width="1%" nowrap>
<i><font color="#ff3434">sql-command</font></i> ::=</td>
<td>
<b><font color="#2c2cf0">CREATE VIRTUAL TABLE </font></b>[<b><font color="#2c2cf0"></font></b><i><font
color="#ff3434">database-name</font></i><b><font color="#2c2cf0"> <big>.</big></font></b>]<b><font
color="#2c2cf0"> </font></b><i><font color="#ff3434">table-name</font></i><b><font
color="#2c2cf0"> USING </font></b><i><font color="#ff3434">module-name</font></i><b><font
color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"><big>(</big> </font></b>
<i><font color="#ff3434">arguments</font></i><b><font color="#2c2cf0"> <big>)</big></font></b>]<b><font
color="#2c2cf0"></font></b></td>
</tr>
</table>
</p>
<p>
A virtual table is an interface to an external storage or computation engine that
appears to be a table but does not actually store information in the database file.</p>
<p>
In general, you can do anything with a virtual table that can be done with an ordinary
table, except that you cannot create triggers on a virtual table. Some virtual table
implementations might impose additional restrictions. For example, many virtual
tables are read-only.</p>
<p>
The <module-name> is the
name of an object that implements the virtual table.
The <module-name> must be registered with the SQLite database connection using
<a href="capi3ref.html#sqlite3_create_module">sqlite3_create_module</a> prior to
issuing the CREATE VIRTUAL TABLE statement. The module takes zero or more comma-separated
arguments. The arguments can be just about any text as long as it has balanced parentheses.
The argument syntax is sufficiently general that the arguments can be made to appear
as column definitions in a traditional <a href="lang_createtable.html">CREATE TABLE</a>
statement. SQLite passes the module arguments directly to the module without any
interpretation. It is the responsibility of the module implementation to parse and
interpret its own arguments.</p>
<p>
A virtual table is destroyed using the ordinary <a href="lang_droptable.html">DROP
TABLE</a> statement. There is no DROP VIRTUAL TABLE statement.</p>
<p>
<hr>
</p>
<div id="footer">
<p>
</p>
<p>
</p>
</div>
</div>
</div>
</body>
</html>