1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::Data::Statement</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Data.html" class="namespace">Poco::Data</a></h1>
<h1 class="symbol">class Statement</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Data<br />
<b>Package:</b> DataCore<br />
<b>Header:</b> Poco/Data/Statement.h</p>
<h2>Description</h2>
<div class="description">
<p>A <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> is used to execute SQL statements. It does not contain code of its own. Its main purpose is to forward calls to the concrete <a href="Poco.Data.StatementImpl.html" title="class Poco::Data::StatementImpl">StatementImpl</a> stored inside. </p>
</div>
<h2>Inheritance</h2>
<p><b>Known Derived Classes: </b><a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Data.Statement.html#3048" title="Poco::Data::Statement::done()">done</a>, <a href="Poco.Data.Statement.html#3047" title="Poco::Data::Statement::execute()">execute</a>, <a href="Poco.Data.Statement.html#3049" title="Poco::Data::Statement::extractions()">extractions</a>, <a href="Poco.Data.Statement.html#3050" title="Poco::Data::Statement::metaColumn()">metaColumn</a>, <a href="Poco.Data.Statement.html#3034" title="Poco::Data::Statement::operator <<()">operator <<</a>, <a href="Poco.Data.Statement.html#3030" title="Poco::Data::Statement::operator =()">operator =</a>, <a href="Poco.Data.Statement.html#3036" title="Poco::Data::Statement::operator,()">operator,</a>, <a href="Poco.Data.Statement.html#3032" title="Poco::Data::Statement::swap()">swap</a>, <a href="Poco.Data.Statement.html#3046" title="Poco::Data::Statement::toString()">toString</a></p>
<h2>Types</h2>
<h3><a name="3022">void</a></h3>
<p class="decl">typedef void (* Manipulator)(<a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> &);</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="3023">Statement</a></h3>
<p class="decl"><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>(<br /> <a href="Poco.Data.StatementImpl.html" title="class Poco::Data::StatementImpl">StatementImpl</a> * pImpl<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>. </p>
</div>
<h3><a name="3025">Statement</a></h3>
<p class="decl">explicit <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>(<br /> <a href="Poco.Data.Session.html" title="class Poco::Data::Session">Session</a> & session<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> for the given <a href="Poco.Data.Session.html" title="class Poco::Data::Session">Session</a>. </p>
<p>The following: </p>
<p></p>
<pre>Statement stmt(sess);
stmt << "SELECT * FROM Table", ...
</pre>
<p>is equivalent to: </p>
<p></p>
<pre>Statement stmt(sess << "SELECT * FROM Table", ...);
</pre>
<p>but in some cases better readable. </p>
</div>
<h3><a name="3028">Statement</a></h3>
<p class="decl"><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>(<br /> const <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & stmt<br />);</p>
<div class="description">
<p>Copy constructor </p>
</div>
<h2>Destructor</h2>
<h3><a name="3027">~Statement</a></h3>
<p class="decl">~<a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="3048">done</a></h3>
<p class="decl">bool done();</p>
<div class="description">
<p>Returns if the statement was completely executed or if a previously set limit stopped it and there is more work to do. When no limit is set, it will always - after calling <a href="Poco.Data.Statement.html#3047" title="Poco::Data::Statement::execute()">execute</a>() - return true. </p>
</div>
<h3><a name="3047">execute</a></h3>
<p class="decl"><a href="Poco.html#11354" title="Poco::UInt32">Poco::UInt32</a> execute();</p>
<div class="description">
<p>Executes the whole statement. Stops when either a limit is hit or the whole statement was executed. Returns the number of rows extracted from the Database. </p>
</div>
<h3><a name="3034">operator <<</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">template < typename T > <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & operator << (<br /> const T & t<br />);</p>
<div class="description">
<p>Concatenates the send data to a string version of the SQL statement. </p>
</div>
<h3><a name="3030">operator =</a></h3>
<p class="decl"><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & operator = (<br /> const <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & stmt<br />);</p>
<div class="description">
<p>Assignment operator. </p>
</div>
<h3><a name="3036">operator,</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & operator, (<br /> Manipulator manip<br />);</p>
<div class="description">
<p>Handles manipulators, such as now. </p>
</div>
<h3><a name="3038">operator,</a></h3>
<p class="decl"><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & operator, (<br /> <a href="Poco.Data.AbstractBinding.html" title="class Poco::Data::AbstractBinding">AbstractBinding</a> * info<br />);</p>
<div class="description">
<p>Registers the <a href="Poco.Data.Binding.html" title="class Poco::Data::Binding">Binding</a> at the <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> </p>
</div>
<h3><a name="3040">operator,</a></h3>
<p class="decl"><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & operator, (<br /> <a href="Poco.Data.AbstractExtraction.html" title="class Poco::Data::AbstractExtraction">AbstractExtraction</a> * extract<br />);</p>
<div class="description">
<p>Registers objects used for extracting data at the <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>. </p>
</div>
<h3><a name="3042">operator,</a></h3>
<p class="decl"><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & operator, (<br /> const <a href="Poco.Data.Limit.html" title="class Poco::Data::Limit">Limit</a> & extrLimit<br />);</p>
<div class="description">
<p>Sets a limit on the maximum number of rows a select is allowed to return. </p>
<p>Set per default to <a href="Poco.Data.Limit.html#2715" title="Poco::Data::Limit::LIMIT_UNLIMITED">Limit::LIMIT_UNLIMITED</a> which disables the limit. </p>
</div>
<h3><a name="3044">operator,</a></h3>
<p class="decl"><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & operator, (<br /> const <a href="Poco.Data.Range.html" title="class Poco::Data::Range">Range</a> & extrRange<br />);</p>
<div class="description">
<p>Sets a an etxraction <a href="Poco.Data.Range.html" title="class Poco::Data::Range">Range</a> on the maximum number of rows a select is allowed to return. </p>
<p>Set per default to <a href="Poco.Data.Limit.html#2715" title="Poco::Data::Limit::LIMIT_UNLIMITED">Limit::LIMIT_UNLIMITED</a> which disables the range. </p>
</div>
<h3><a name="3032">swap</a></h3>
<p class="decl">void swap(<br /> <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & other<br />);</p>
<div class="description">
<p>Swaps the statement with another one. </p>
</div>
<h3><a name="3046">toString</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::string toString() const;</p>
<div class="description">
<p>Creates a string from the accumulated SQL statement </p>
</div>
<h3><a name="3049">extractions</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const <a href="Poco.Data.html#2155" title="Poco::Data::AbstractExtractionVec">AbstractExtractionVec</a> & extractions() const;</p>
<div class="description">
<p>Returns the extractions vector. </p>
</div>
<h3><a name="3050">metaColumn</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const <a href="Poco.Data.MetaColumn.html" title="class Poco::Data::MetaColumn">MetaColumn</a> & metaColumn(<br /> std::size_t pos<br />) const;</p>
<div class="description">
<p>Returns the type for the column at specified position. </p>
</div>
<h3><a name="3052">metaColumn</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const <a href="Poco.Data.MetaColumn.html" title="class Poco::Data::MetaColumn">MetaColumn</a> & metaColumn(<br /> const std::string & name<br />) const;</p>
<div class="description">
<p>Returns the type for the column with specified name. </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>
</div>
</body>
</html>
|