Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split basics.html into two separate pages
Rename basics.html to connections.html Add queries.html with simple queries copied from connections.html [ci skip]
- Loading branch information
Showing
3 changed files
with
66 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> | ||
<head> | ||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> | ||
<link rel="stylesheet" type="text/css" href="style.css" /> | ||
<title>SOCI - queries</title> | ||
</head> | ||
|
||
<body> | ||
<p class="banner">SOCI - The C++ Database Access Library</p> | ||
|
||
<h2>Queries</h2> | ||
|
||
<h3>Simple SQL statements</h3> | ||
|
||
<p>In many cases, the SQL query is intended to be executed only once, | ||
which means that statement parsing and execution can go together. | ||
The <code>session</code> class provides a special <code>once</code> | ||
member, which triggers parsing and execution of such one-time | ||
statements:</p> | ||
|
||
<pre class="example"> | ||
sql.once << "drop table persons"; | ||
</pre> | ||
|
||
<p>For shorter syntax, the following form is also allowed:</p> | ||
|
||
<pre class="example"> | ||
sql << "drop table persons"; | ||
</pre> | ||
|
||
<p>The IOStream-like interface is exactly what it looks like, so that | ||
the | ||
statement text can be composed of many parts, involving anything that | ||
is <i>streamable</i> (including custom classes, if they have | ||
appropriate <code>operator<<</code>):</p> | ||
|
||
<pre class="example"> | ||
string tableName = "persons"; | ||
sql << "drop table " << tableName; | ||
|
||
int id = 123; | ||
sql << "delete from companies where id = " << id; | ||
</pre> | ||
|
||
<table class="foot-links" border="0" cellpadding="2" cellspacing="2"> | ||
<tr> | ||
<td class="foot-link-left"> | ||
<a href="connections.html">Previous (Connections)</a> | ||
</td> | ||
<td class="foot-link-right"> | ||
<a href="exchange.html">Next (Exchanging data)</a> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
<p class="copyright">Copyright © 2013 Mateusz Loskot</p> | ||
<p class="copyright">Copyright © 2004-2008 Maciej Sobczak, Stephen Hutton</p> | ||
</body> | ||
</html> |