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 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
<!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::RecordSet</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 RecordSet</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Data<br />
<b>Package:</b> DataCore<br />
<b>Header:</b> Poco/Data/RecordSet.h</p>
<h2>Description</h2>
<div class="description">
<p><a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a> provides access to data returned from a query. <a href="Poco.Data.html" title="namespace Poco::Data">Data</a> access indexes (row and column) are 0-based, as usual in C++. </p>
<p>Recordset provides navigation methods to iterate through the recordset, retrieval methods to extract data, and methods to get metadata (type, etc.) about columns. </p>
<p>To work with a <a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a>, first create a <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>, execute it, and create the <a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a> from the <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>, as follows: </p>
<p></p>
<pre>Statement select(session);
select << "SELECT * FROM Person";
select.execute();
RecordSet rs(select);
</pre>
<p>The number of rows in the <a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a> can be limited by specifying a limit for the <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a>. </p>
</div>
<h2>Inheritance</h2>
<p><b>Direct Base Classes: </b><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a></p>
<p><b>All Base Classes: </b><a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Data.RecordSet.html#2850" title="Poco::Data::RecordSet::column()">column</a>, <a href="Poco.Data.RecordSet.html#2849" title="Poco::Data::RecordSet::columnCount()">columnCount</a>, <a href="Poco.Data.RecordSet.html#2884" title="Poco::Data::RecordSet::columnLength()">columnLength</a>, <a href="Poco.Data.RecordSet.html#2882" title="Poco::Data::RecordSet::columnName()">columnName</a>, <a href="Poco.Data.RecordSet.html#2888" title="Poco::Data::RecordSet::columnPrecision()">columnPrecision</a>, <a href="Poco.Data.RecordSet.html#2878" title="Poco::Data::RecordSet::columnType()">columnType</a>, <a href="Poco.Data.RecordSet.html#2866" title="Poco::Data::RecordSet::moveFirst()">moveFirst</a>, <a href="Poco.Data.RecordSet.html#2869" title="Poco::Data::RecordSet::moveLast()">moveLast</a>, <a href="Poco.Data.RecordSet.html#2867" title="Poco::Data::RecordSet::moveNext()">moveNext</a>, <a href="Poco.Data.RecordSet.html#2868" title="Poco::Data::RecordSet::movePrevious()">movePrevious</a>, <a href="Poco.Data.RecordSet.html#2874" title="Poco::Data::RecordSet::operator()">operator</a>, <a href="Poco.Data.RecordSet.html#2846" title="Poco::Data::RecordSet::operator =()">operator =</a>, <a href="Poco.Data.RecordSet.html#2848" title="Poco::Data::RecordSet::rowCount()">rowCount</a>, <a href="Poco.Data.RecordSet.html#2854" title="Poco::Data::RecordSet::value()">value</a></p>
<p><b>Inherited 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>Constructors</h2>
<h3><a name="2843">RecordSet</a></h3>
<p class="decl">explicit <a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a>(<br /> const <a href="Poco.Data.Statement.html" title="class Poco::Data::Statement">Statement</a> & rStatement<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a>. </p>
</div>
<h2>Destructor</h2>
<h3><a name="2845">~RecordSet</a></h3>
<p class="decl">~<a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="2850">column</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">template < class T > const <a href="Poco.Data.Column.html" title="class Poco::Data::Column">Column</a> < T > & column(<br /> const std::string & name<br />) const;</p>
<div class="description">
<p>Returns the reference to the first <a href="Poco.Data.Column.html" title="class Poco::Data::Column">Column</a> with the specified name. </p>
</div>
<h3><a name="2852">column</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">template < class T > const <a href="Poco.Data.Column.html" title="class Poco::Data::Column">Column</a> < T > & column(<br /> std::size_t pos<br />) const;</p>
<div class="description">
<p>Returns the reference to column at specified location. </p>
</div>
<h3><a name="2849">columnCount</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::size_t columnCount() const;</p>
<div class="description">
<p>Returns the number of rows in the recordset. </p>
</div>
<h3><a name="2884">columnLength</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::size_t columnLength(<br /> std::size_t pos<br />) const;</p>
<div class="description">
<p>Returns column maximum length for the column at specified position. </p>
</div>
<h3><a name="2886">columnLength</a></h3>
<p class="decl">std::size_t columnLength(<br /> const std::string & name<br />) const;</p>
<div class="description">
<p>Returns column maximum length for the column with specified name. </p>
</div>
<h3><a name="2882">columnName</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & columnName(<br /> std::size_t pos<br />) const;</p>
<div class="description">
<p>Returns column name for the column at specified position. </p>
</div>
<h3><a name="2888">columnPrecision</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::size_t columnPrecision(<br /> std::size_t pos<br />) const;</p>
<div class="description">
<p>Returns column precision for the column at specified position. Valid for floating point fields only (zero for other data types). </p>
</div>
<h3><a name="2890">columnPrecision</a></h3>
<p class="decl">std::size_t columnPrecision(<br /> const std::string & name<br />) const;</p>
<div class="description">
<p>Returns column precision for the column with specified name. Valid for floating point fields only (zero for other data types). </p>
</div>
<h3><a name="2878">columnType</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Data.MetaColumn.html#2728" title="enum Poco::Data::MetaColumn::ColumnDataType">MetaColumn::ColumnDataType</a> columnType(<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="2880">columnType</a></h3>
<p class="decl"><a href="Poco.Data.MetaColumn.html#2728" title="enum Poco::Data::MetaColumn::ColumnDataType">MetaColumn::ColumnDataType</a> columnType(<br /> const std::string & name<br />) const;</p>
<div class="description">
<p>Returns the type for the column with specified name. </p>
</div>
<h3><a name="2866">moveFirst</a></h3>
<p class="decl">bool moveFirst();</p>
<div class="description">
<p>Moves the row cursor to the first row. </p>
<p>Returns true if there is at least one row in the <a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a>, false otherwise. </p>
</div>
<h3><a name="2869">moveLast</a></h3>
<p class="decl">bool moveLast();</p>
<div class="description">
<p>Moves the row cursor to the last row. </p>
<p>Returns true if there is at least one row in the <a href="Poco.Data.RecordSet.html" title="class Poco::Data::RecordSet">RecordSet</a>, false otherwise. </p>
</div>
<h3><a name="2867">moveNext</a></h3>
<p class="decl">bool moveNext();</p>
<div class="description">
<p>Moves the row cursor to the next row. </p>
<p>Returns true if the row is available, or false if the end of the record set has been reached and no more rows are available. </p>
</div>
<h3><a name="2868">movePrevious</a></h3>
<p class="decl">bool movePrevious();</p>
<div class="description">
<p>Moves the row cursor to the previous row. </p>
<p>Returns true if the row is available, or false if there are no more rows available. </p>
</div>
<h3><a name="2874">operator</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.DynamicAny.html" title="class Poco::DynamicAny">DynamicAny</a> operator[] (<br /> const std::string & name<br />);</p>
<div class="description">
<p>Returns the value in the named column of the current row. </p>
</div>
<h3><a name="2876">operator</a></h3>
<p class="decl"><a href="Poco.DynamicAny.html" title="class Poco::DynamicAny">DynamicAny</a> operator[] (<br /> std::size_t index<br />);</p>
<div class="description">
<p>Returns the value in the named column of the current row. </p>
</div>
<h3><a name="2846">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 /> 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="2848">rowCount</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::size_t rowCount() const;</p>
<div class="description">
<p>Returns the number of rows in the recordset. </p>
</div>
<h3><a name="2854">value</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">template < class T > const T & value(<br /> std::size_t col,<br /> std::size_t row<br />) const;</p>
<div class="description">
<p>Returns the reference to data value at [col, row] location. </p>
</div>
<h3><a name="2857">value</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">template < class T > const T & value(<br /> const std::string & name,<br /> std::size_t row<br />) const;</p>
<div class="description">
<p>Returns the reference to data value at named column, row location. </p>
</div>
<h3><a name="2860">value</a></h3>
<p class="decl"><a href="Poco.DynamicAny.html" title="class Poco::DynamicAny">DynamicAny</a> value(<br /> std::size_t col,<br /> std::size_t row<br />) const;</p>
<div class="description">
<p>Returns the reference to data value at column, row location. </p>
</div>
<h3><a name="2863">value</a></h3>
<p class="decl"><a href="Poco.DynamicAny.html" title="class Poco::DynamicAny">DynamicAny</a> value(<br /> const std::string & name,<br /> std::size_t row<br />) const;</p>
<div class="description">
<p>Returns the reference to data value at named column, row location. </p>
</div>
<h3><a name="2870">value</a></h3>
<p class="decl"><a href="Poco.DynamicAny.html" title="class Poco::DynamicAny">DynamicAny</a> value(<br /> const std::string & name<br />);</p>
<div class="description">
<p>Returns the value in the named column of the current row. </p>
</div>
<h3><a name="2872">value</a></h3>
<p class="decl"><a href="Poco.DynamicAny.html" title="class Poco::DynamicAny">DynamicAny</a> value(<br /> std::size_t index<br />);</p>
<div class="description">
<p>Returns the value in the given column of the current row. </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>
|