Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6431

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!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_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qsqlresult.cpp -->
  <title>Qt 4.8: QSqlResult Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtsql.html">QtSql</a></li>
<li>QSqlResult</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-types">Protected Types</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QSqlResult Class Reference</h1>
<!-- $$$QSqlResult-brief -->
<p>The QSqlResult class provides an abstract interface for accessing data from specific SQL databases. <a href="#details">More...</a></p>
<!-- @@@QSqlResult -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QSqlResult&gt;</span></pre><ul>
<li><a href="qsqlresult-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#dtor.QSqlResult">~QSqlResult</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#handle">handle</a></b> () const</td></tr>
</table>
<a name="protected-types"></a>
<h2>Protected Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#BindingSyntax-enum">BindingSyntax</a></b> { PositionalBinding, NamedBinding }</td></tr>
</table>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#QSqlResult">QSqlResult</a></b> ( const QSqlDriver * <i>db</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#addBindValue">addBindValue</a></b> ( const QVariant &amp; <i>val</i>, QSql::ParamType <i>paramType</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#at">at</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#bindValue">bindValue</a></b> ( int <i>index</i>, const QVariant &amp; <i>val</i>, QSql::ParamType <i>paramType</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#bindValue-2">bindValue</a></b> ( const QString &amp; <i>placeholder</i>, const QVariant &amp; <i>val</i>, QSql::ParamType <i>paramType</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSql::ParamType </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#bindValueType">bindValueType</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSql::ParamType </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#bindValueType-2">bindValueType</a></b> ( const QString &amp; <i>placeholder</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> BindingSyntax </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#bindingSyntax">bindingSyntax</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#boundValue">boundValue</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#boundValue-2">boundValue</a></b> ( const QString &amp; <i>placeholder</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#boundValueCount">boundValueCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#boundValueName">boundValueName</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector&lt;QVariant&gt; &amp; </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#boundValues">boundValues</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#data">data</a></b> ( int <i>index</i> ) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QSqlDriver * </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#driver">driver</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#exec">exec</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#executedQuery">executedQuery</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#fetch">fetch</a></b> ( int <i>index</i> ) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#fetchFirst">fetchFirst</a></b> () = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#fetchLast">fetchLast</a></b> () = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#fetchNext">fetchNext</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#fetchPrevious">fetchPrevious</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#hasOutValues">hasOutValues</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#isActive">isActive</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#isForwardOnly">isForwardOnly</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#isNull">isNull</a></b> ( int <i>index</i> ) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#isSelect">isSelect</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSqlError </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#lastError">lastError</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#lastInsertId">lastInsertId</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#lastQuery">lastQuery</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#numRowsAffected">numRowsAffected</a></b> () = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#prepare">prepare</a></b> ( const QString &amp; <i>query</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSqlRecord </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#record">record</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#reset">reset</a></b> ( const QString &amp; <i>query</i> ) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#savePrepare">savePrepare</a></b> ( const QString &amp; <i>query</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#setActive">setActive</a></b> ( bool <i>active</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#setAt">setAt</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#setForwardOnly">setForwardOnly</a></b> ( bool <i>forward</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#setLastError">setLastError</a></b> ( const QSqlError &amp; <i>error</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#setQuery">setQuery</a></b> ( const QString &amp; <i>query</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#setSelect">setSelect</a></b> ( bool <i>select</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qsqlresult.html#size">size</a></b> () = 0</td></tr>
</table>
<a name="details"></a>
<!-- $$$QSqlResult-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QSqlResult class provides an abstract interface for accessing data from specific SQL databases.</p>
<p>Normally, you would use <a href="qsqlquery.html">QSqlQuery</a> instead of QSqlResult, since <a href="qsqlquery.html">QSqlQuery</a> provides a generic wrapper for database-specific implementations of QSqlResult.</p>
<p>If you are implementing your own SQL driver (by subclassing <a href="qsqldriver.html">QSqlDriver</a>), you will need to provide your own QSqlResult subclass that implements all the pure virtual functions and other virtual functions that you need.</p>
</div>
<p><b>See also </b><a href="qsqldriver.html">QSqlDriver</a>.</p>
<!-- @@@QSqlResult -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$BindingSyntax$$$PositionalBinding$$$NamedBinding$$$BindByPosition$$$BindByName -->
<h3 class="fn"><a name="BindingSyntax-enum"></a>enum QSqlResult::<span class="name">BindingSyntax</span></h3>
<p>This enum type specifies the different syntaxes for specifying placeholders in prepared queries.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QSqlResult::PositionalBinding</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">Use the ODBC-style positional syntax, with &quot;?&quot; as placeholders.</td></tr>
<tr><td class="topAlign"><tt>QSqlResult::NamedBinding</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">Use the Oracle-style syntax with named placeholders (e.g&#x2e;, &quot;:id&quot;)</td></tr>
</table>
<p><b>See also </b><a href="qsqlresult.html#bindingSyntax">bindingSyntax</a>().</p>
<!-- @@@BindingSyntax -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QSqlResult[overload1]$$$QSqlResultconstQSqlDriver* -->
<h3 class="fn"><a name="QSqlResult"></a>QSqlResult::<span class="name">QSqlResult</span> ( const <span class="type"><a href="qsqldriver.html">QSqlDriver</a></span> * <i>db</i> )<tt> [protected]</tt></h3>
<p>Creates a <a href="qsqlresult.html">QSqlResult</a> using database driver <i>db</i>. The object is initialized to an inactive state.</p>
<p><b>See also </b><a href="qsqlresult.html#isActive">isActive</a>() and <a href="qsqlresult.html#driver">driver</a>().</p>
<!-- @@@QSqlResult -->
<!-- $$$~QSqlResult[overload1]$$$~QSqlResult -->
<h3 class="fn"><a name="dtor.QSqlResult"></a>QSqlResult::<span class="name">~QSqlResult</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the object and frees any allocated resources.</p>
<!-- @@@~QSqlResult -->
<!-- $$$addBindValue[overload1]$$$addBindValueconstQVariant&QSql::ParamType -->
<h3 class="fn"><a name="addBindValue"></a><span class="type">void</span> QSqlResult::<span class="name">addBindValue</span> ( const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>val</i>, <span class="type"><a href="qsql.html#ParamTypeFlag-enum">QSql::ParamType</a></span> <i>paramType</i> )<tt> [protected]</tt></h3>
<p>Binds the value <i>val</i> of parameter type <i>paramType</i> to the next available position in the current record (row).</p>
<p><b>See also </b><a href="qsqlresult.html#bindValue">bindValue</a>().</p>
<!-- @@@addBindValue -->
<!-- $$$at[overload1]$$$at -->
<h3 class="fn"><a name="at"></a><span class="type">int</span> QSqlResult::<span class="name">at</span> () const<tt> [protected]</tt></h3>
<p>Returns the current (zero-based) row position of the result. May return the special values <a href="qsql.html#Location-enum">QSql::BeforeFirstRow</a> or <a href="qsql.html#Location-enum">QSql::AfterLastRow</a>.</p>
<p><b>See also </b><a href="qsqlresult.html#setAt">setAt</a>() and <a href="qsqlresult.html#isValid">isValid</a>().</p>
<!-- @@@at -->
<!-- $$$bindValue[overload1]$$$bindValueintconstQVariant&QSql::ParamType -->
<h3 class="fn"><a name="bindValue"></a><span class="type">void</span> QSqlResult::<span class="name">bindValue</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>val</i>, <span class="type"><a href="qsql.html#ParamTypeFlag-enum">QSql::ParamType</a></span> <i>paramType</i> )<tt> [virtual protected]</tt></h3>
<p>Binds the value <i>val</i> of parameter type <i>paramType</i> to position <i>index</i> in the current record (row).</p>
<p><b>See also </b><a href="qsqlresult.html#addBindValue">addBindValue</a>().</p>
<!-- @@@bindValue -->
<!-- $$$bindValue$$$bindValueconstQString&constQVariant&QSql::ParamType -->
<h3 class="fn"><a name="bindValue-2"></a><span class="type">void</span> QSqlResult::<span class="name">bindValue</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>placeholder</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>val</i>, <span class="type"><a href="qsql.html#ParamTypeFlag-enum">QSql::ParamType</a></span> <i>paramType</i> )<tt> [virtual protected]</tt></h3>
<p>This is an overloaded function.</p>
<p>Binds the value <i>val</i> of parameter type <i>paramType</i> to the <i>placeholder</i> name in the current record (row).</p>
<p>Values cannot be bound to multiple locations in the query, eg:</p>
<pre class="cpp"> INSERT INTO testtable (id<span class="operator">,</span> name<span class="operator">,</span> samename) VALUES (:id<span class="operator">,</span> :name<span class="operator">,</span> :name)</pre>
<p>Binding to name will bind to the first :name, but not the second.</p>
<p><b>Note:</b> Binding an undefined placeholder will result in undefined behavior.</p>
<p><b>See also </b><a href="qsqlquery.html#bindValue">QSqlQuery::bindValue</a>().</p>
<!-- @@@bindValue -->
<!-- $$$bindValueType[overload1]$$$bindValueTypeint -->
<h3 class="fn"><a name="bindValueType"></a><span class="type"><a href="qsql.html#ParamTypeFlag-enum">QSql::ParamType</a></span> QSqlResult::<span class="name">bindValueType</span> ( <span class="type">int</span> <i>index</i> ) const<tt> [protected]</tt></h3>
<p>Returns the parameter type for the value bound at position <i>index</i>.</p>
<p><b>See also </b><a href="qsqlresult.html#boundValue">boundValue</a>().</p>
<!-- @@@bindValueType -->
<!-- $$$bindValueType$$$bindValueTypeconstQString& -->
<h3 class="fn"><a name="bindValueType-2"></a><span class="type"><a href="qsql.html#ParamTypeFlag-enum">QSql::ParamType</a></span> QSqlResult::<span class="name">bindValueType</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>placeholder</i> ) const<tt> [protected]</tt></h3>
<p>This is an overloaded function.</p>
<p>Returns the parameter type for the value bound with the given <i>placeholder</i> name.</p>
<!-- @@@bindValueType -->
<!-- $$$bindingSyntax[overload1]$$$bindingSyntax -->
<h3 class="fn"><a name="bindingSyntax"></a><span class="type"><a href="qsqlresult.html#BindingSyntax-enum">BindingSyntax</a></span> QSqlResult::<span class="name">bindingSyntax</span> () const<tt> [protected]</tt></h3>
<p>Returns the binding syntax used by prepared queries.</p>
<!-- @@@bindingSyntax -->
<!-- $$$boundValue[overload1]$$$boundValueint -->
<h3 class="fn"><a name="boundValue"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QSqlResult::<span class="name">boundValue</span> ( <span class="type">int</span> <i>index</i> ) const<tt> [protected]</tt></h3>
<p>Returns the value bound at position <i>index</i> in the current record (row).</p>
<p><b>See also </b><a href="qsqlresult.html#bindValue">bindValue</a>() and <a href="qsqlresult.html#boundValues">boundValues</a>().</p>
<!-- @@@boundValue -->
<!-- $$$boundValue$$$boundValueconstQString& -->
<h3 class="fn"><a name="boundValue-2"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QSqlResult::<span class="name">boundValue</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>placeholder</i> ) const<tt> [protected]</tt></h3>
<p>This is an overloaded function.</p>
<p>Returns the value bound by the given <i>placeholder</i> name in the current record (row).</p>
<p><b>See also </b><a href="qsqlresult.html#bindValueType">bindValueType</a>().</p>
<!-- @@@boundValue -->
<!-- $$$boundValueCount[overload1]$$$boundValueCount -->
<h3 class="fn"><a name="boundValueCount"></a><span class="type">int</span> QSqlResult::<span class="name">boundValueCount</span> () const<tt> [protected]</tt></h3>
<p>Returns the number of bound values in the result.</p>
<p><b>See also </b><a href="qsqlresult.html#boundValues">boundValues</a>().</p>
<!-- @@@boundValueCount -->
<!-- $$$boundValueName[overload1]$$$boundValueNameint -->
<h3 class="fn"><a name="boundValueName"></a><span class="type"><a href="qstring.html">QString</a></span> QSqlResult::<span class="name">boundValueName</span> ( <span class="type">int</span> <i>index</i> ) const<tt> [protected]</tt></h3>
<p>Returns the name of the bound value at position <i>index</i> in the current record (row).</p>
<p><b>See also </b><a href="qsqlresult.html#boundValue">boundValue</a>().</p>
<!-- @@@boundValueName -->
<!-- $$$boundValues[overload1]$$$boundValues -->
<h3 class="fn"><a name="boundValues"></a><span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qvariant.html">QVariant</a></span>&gt; &amp; QSqlResult::<span class="name">boundValues</span> () const<tt> [protected]</tt></h3>
<p>Returns a vector of the result's bound values for the current record (row).</p>
<p><b>See also </b><a href="qsqlresult.html#boundValueCount">boundValueCount</a>().</p>
<!-- @@@boundValues -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QSqlResult::<span class="name">clear</span> ()<tt> [protected]</tt></h3>
<p>Clears the entire result set and releases any associated resources.</p>
<!-- @@@clear -->
<!-- $$$data[overload1]$$$dataint -->
<h3 class="fn"><a name="data"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QSqlResult::<span class="name">data</span> ( <span class="type">int</span> <i>index</i> )<tt> [pure virtual protected]</tt></h3>
<p>Returns the data for field <i>index</i> in the current row as a <a href="qvariant.html">QVariant</a>. This function is only called if the result is in an active state and is positioned on a valid record and <i>index</i> is non-negative. Derived classes must reimplement this function and return the value of field <i>index</i>, or QVariant() if it cannot be determined.</p>
<!-- @@@data -->
<!-- $$$driver[overload1]$$$driver -->
<h3 class="fn"><a name="driver"></a>const <span class="type"><a href="qsqldriver.html">QSqlDriver</a></span> * QSqlResult::<span class="name">driver</span> () const<tt> [protected]</tt></h3>
<p>Returns the driver associated with the result. This is the object that was passed to the constructor.</p>
<!-- @@@driver -->
<!-- $$$exec[overload1]$$$exec -->
<h3 class="fn"><a name="exec"></a><span class="type">bool</span> QSqlResult::<span class="name">exec</span> ()<tt> [virtual protected]</tt></h3>
<p>Executes the query, returning true if successful; otherwise returns false.</p>
<p><b>See also </b><a href="qsqlresult.html#prepare">prepare</a>().</p>
<!-- @@@exec -->
<!-- $$$executedQuery[overload1]$$$executedQuery -->
<h3 class="fn"><a name="executedQuery"></a><span class="type"><a href="qstring.html">QString</a></span> QSqlResult::<span class="name">executedQuery</span> () const<tt> [protected]</tt></h3>
<p>Returns the query that was actually executed. This may differ from the query that was passed, for example if bound values were used with a prepared query and the underlying database doesn't support prepared queries.</p>
<p><b>See also </b><a href="qsqlresult.html#exec">exec</a>() and <a href="qsqlresult.html#setQuery">setQuery</a>().</p>
<!-- @@@executedQuery -->
<!-- $$$fetch[overload1]$$$fetchint -->
<h3 class="fn"><a name="fetch"></a><span class="type">bool</span> QSqlResult::<span class="name">fetch</span> ( <span class="type">int</span> <i>index</i> )<tt> [pure virtual protected]</tt></h3>
<p>Positions the result to an arbitrary (zero-based) row <i>index</i>.</p>
<p>This function is only called if the result is in an active state. Derived classes must reimplement this function and position the result to the row <i>index</i>, and call <a href="qsqlresult.html#setAt">setAt</a>() with an appropriate value. Return true to indicate success, or false to signify failure.</p>
<p><b>See also </b><a href="qsqlresult.html#isActive">isActive</a>(), <a href="qsqlresult.html#fetchFirst">fetchFirst</a>(), <a href="qsqlresult.html#fetchLast">fetchLast</a>(), <a href="qsqlresult.html#fetchNext">fetchNext</a>(), and <a href="qsqlresult.html#fetchPrevious">fetchPrevious</a>().</p>
<!-- @@@fetch -->
<!-- $$$fetchFirst[overload1]$$$fetchFirst -->
<h3 class="fn"><a name="fetchFirst"></a><span class="type">bool</span> QSqlResult::<span class="name">fetchFirst</span> ()<tt> [pure virtual protected]</tt></h3>
<p>Positions the result to the first record (row 0) in the result.</p>
<p>This function is only called if the result is in an active state. Derived classes must reimplement this function and position the result to the first record, and call <a href="qsqlresult.html#setAt">setAt</a>() with an appropriate value. Return true to indicate success, or false to signify failure.</p>
<p><b>See also </b><a href="qsqlresult.html#fetch">fetch</a>() and <a href="qsqlresult.html#fetchLast">fetchLast</a>().</p>
<!-- @@@fetchFirst -->
<!-- $$$fetchLast[overload1]$$$fetchLast -->
<h3 class="fn"><a name="fetchLast"></a><span class="type">bool</span> QSqlResult::<span class="name">fetchLast</span> ()<tt> [pure virtual protected]</tt></h3>
<p>Positions the result to the last record (last row) in the result.</p>
<p>This function is only called if the result is in an active state. Derived classes must reimplement this function and position the result to the last record, and call <a href="qsqlresult.html#setAt">setAt</a>() with an appropriate value. Return true to indicate success, or false to signify failure.</p>
<p><b>See also </b><a href="qsqlresult.html#fetch">fetch</a>() and <a href="qsqlresult.html#fetchFirst">fetchFirst</a>().</p>
<!-- @@@fetchLast -->
<!-- $$$fetchNext[overload1]$$$fetchNext -->
<h3 class="fn"><a name="fetchNext"></a><span class="type">bool</span> QSqlResult::<span class="name">fetchNext</span> ()<tt> [virtual protected]</tt></h3>
<p>Positions the result to the next available record (row) in the result.</p>
<p>This function is only called if the result is in an active state. The default implementation calls <a href="qsqlresult.html#fetch">fetch</a>() with the next index. Derived classes can reimplement this function and position the result to the next record in some other way, and call <a href="qsqlresult.html#setAt">setAt</a>() with an appropriate value. Return true to indicate success, or false to signify failure.</p>
<p><b>See also </b><a href="qsqlresult.html#fetch">fetch</a>() and <a href="qsqlresult.html#fetchPrevious">fetchPrevious</a>().</p>
<!-- @@@fetchNext -->
<!-- $$$fetchPrevious[overload1]$$$fetchPrevious -->
<h3 class="fn"><a name="fetchPrevious"></a><span class="type">bool</span> QSqlResult::<span class="name">fetchPrevious</span> ()<tt> [virtual protected]</tt></h3>
<p>Positions the result to the previous record (row) in the result.</p>
<p>This function is only called if the result is in an active state. The default implementation calls <a href="qsqlresult.html#fetch">fetch</a>() with the previous index. Derived classes can reimplement this function and position the result to the next record in some other way, and call <a href="qsqlresult.html#setAt">setAt</a>() with an appropriate value. Return true to indicate success, or false to signify failure.</p>
<!-- @@@fetchPrevious -->
<!-- $$$handle[overload1]$$$handle -->
<h3 class="fn"><a name="handle"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QSqlResult::<span class="name">handle</span> () const<tt> [virtual]</tt></h3>
<p>Returns the low-level database handle for this result set wrapped in a <a href="qvariant.html">QVariant</a> or an invalid <a href="qvariant.html">QVariant</a> if there is no handle.</p>
<p><b>Warning:</b> Use this with uttermost care and only if you know what you're doing.</p>
<p><b>Warning:</b> The handle returned here can become a stale pointer if the result is modified (for example, if you clear it).</p>
<p><b>Warning:</b> The handle can be NULL if the result was not executed yet.</p>
<p>The handle returned here is database-dependent, you should query the type name of the variant before accessing it.</p>
<p>This example retrieves the handle for a sqlite result:</p>
<pre class="cpp"> <span class="type"><a href="qsqlquery.html">QSqlQuery</a></span> query <span class="operator">=</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 <span class="type"><a href="qvariant.html">QVariant</a></span> v <span class="operator">=</span> query<span class="operator">.</span>result()<span class="operator">-</span><span class="operator">&gt;</span>handle();
 <span class="keyword">if</span> (v<span class="operator">.</span>isValid() <span class="operator">&amp;</span><span class="operator">&amp;</span> qstrcmp(v<span class="operator">.</span>typeName()<span class="operator">,</span> <span class="string">&quot;sqlite3_stmt*&quot;</span>)) {
     <span class="comment">// v.data() returns a pointer to the handle</span>
     sqlite3_stmt <span class="operator">*</span>handle <span class="operator">=</span> <span class="operator">*</span><span class="keyword">static_cast</span><span class="operator">&lt;</span>sqlite3_stmt <span class="operator">*</span><span class="operator">*</span><span class="operator">&gt;</span>(v<span class="operator">.</span>data());
     <span class="keyword">if</span> (handle <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>) { <span class="comment">// check that it is not NULL</span>
         <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     }
 }</pre>
<p>This snippet returns the handle for PostgreSQL or MySQL:</p>
<pre class="cpp"> <span class="keyword">if</span> (v<span class="operator">.</span>typeName() <span class="operator">=</span><span class="operator">=</span> <span class="string">&quot;PGresult*&quot;</span>) {
     PGresult <span class="operator">*</span>handle <span class="operator">=</span> <span class="operator">*</span><span class="keyword">static_cast</span><span class="operator">&lt;</span>PGresult <span class="operator">*</span><span class="operator">*</span><span class="operator">&gt;</span>(v<span class="operator">.</span>data());
     <span class="keyword">if</span> (handle <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>) <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 }

 <span class="keyword">if</span> (v<span class="operator">.</span>typeName() <span class="operator">=</span><span class="operator">=</span> <span class="string">&quot;MYSQL_STMT*&quot;</span>) {
     MYSQL_STMT <span class="operator">*</span>handle <span class="operator">=</span> <span class="operator">*</span><span class="keyword">static_cast</span><span class="operator">&lt;</span>MYSQL_STMT <span class="operator">*</span><span class="operator">*</span><span class="operator">&gt;</span>(v<span class="operator">.</span>data());
     <span class="keyword">if</span> (handle <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>) <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 }</pre>
<p><b>See also </b><a href="qsqldriver.html#handle">QSqlDriver::handle</a>().</p>
<!-- @@@handle -->
<!-- $$$hasOutValues[overload1]$$$hasOutValues -->
<h3 class="fn"><a name="hasOutValues"></a><span class="type">bool</span> QSqlResult::<span class="name">hasOutValues</span> () const<tt> [protected]</tt></h3>
<p>Returns true if at least one of the query's bound values is a <tt>QSql::Out</tt> or a <a href="qsql.html#ParamTypeFlag-enum">QSql::InOut</a>; otherwise returns false.</p>
<p><b>See also </b><a href="qsqlresult.html#bindValueType">bindValueType</a>().</p>
<!-- @@@hasOutValues -->
<!-- $$$isActive[overload1]$$$isActive -->
<h3 class="fn"><a name="isActive"></a><span class="type">bool</span> QSqlResult::<span class="name">isActive</span> () const<tt> [protected]</tt></h3>
<p>Returns true if the result has records to be retrieved; otherwise returns false.</p>
<!-- @@@isActive -->
<!-- $$$isForwardOnly[overload1]$$$isForwardOnly -->
<h3 class="fn"><a name="isForwardOnly"></a><span class="type">bool</span> QSqlResult::<span class="name">isForwardOnly</span> () const<tt> [protected]</tt></h3>
<p>Returns true if you can only scroll forward through the result set; otherwise returns false.</p>
<p><b>See also </b><a href="qsqlresult.html#setForwardOnly">setForwardOnly</a>().</p>
<!-- @@@isForwardOnly -->
<!-- $$$isNull[overload1]$$$isNullint -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QSqlResult::<span class="name">isNull</span> ( <span class="type">int</span> <i>index</i> )<tt> [pure virtual protected]</tt></h3>
<p>Returns true if the field at position <i>index</i> in the current row is null; otherwise returns false.</p>
<!-- @@@isNull -->
<!-- $$$isSelect[overload1]$$$isSelect -->
<h3 class="fn"><a name="isSelect"></a><span class="type">bool</span> QSqlResult::<span class="name">isSelect</span> () const<tt> [protected]</tt></h3>
<p>Returns true if the current result is from a <tt>SELECT</tt> statement; otherwise returns false.</p>
<p><b>See also </b><a href="qsqlresult.html#setSelect">setSelect</a>().</p>
<!-- @@@isSelect -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QSqlResult::<span class="name">isValid</span> () const<tt> [protected]</tt></h3>
<p>Returns true if the result is positioned on a valid record (that is, the result is not positioned before the first or after the last record); otherwise returns false.</p>
<p><b>See also </b><a href="qsqlresult.html#at">at</a>().</p>
<!-- @@@isValid -->
<!-- $$$lastError[overload1]$$$lastError -->
<h3 class="fn"><a name="lastError"></a><span class="type"><a href="qsqlerror.html">QSqlError</a></span> QSqlResult::<span class="name">lastError</span> () const<tt> [protected]</tt></h3>
<p>Returns the last error associated with the result.</p>
<p><b>See also </b><a href="qsqlresult.html#setLastError">setLastError</a>().</p>
<!-- @@@lastError -->
<!-- $$$lastInsertId[overload1]$$$lastInsertId -->
<h3 class="fn"><a name="lastInsertId"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QSqlResult::<span class="name">lastInsertId</span> () const<tt> [virtual protected]</tt></h3>
<p>Returns the object ID of the most recent inserted row if the database supports it. An invalid <a href="qvariant.html">QVariant</a> will be returned if the query did not insert any value or if the database does not report the id back. If more than one row was touched by the insert, the behavior is undefined.</p>
<p>Note that for Oracle databases the row's ROWID will be returned, while for MySQL databases the row's auto-increment field will be returned.</p>
<p><b>See also </b><a href="qsqldriver.html#hasFeature">QSqlDriver::hasFeature</a>().</p>
<!-- @@@lastInsertId -->
<!-- $$$lastQuery[overload1]$$$lastQuery -->
<h3 class="fn"><a name="lastQuery"></a><span class="type"><a href="qstring.html">QString</a></span> QSqlResult::<span class="name">lastQuery</span> () const<tt> [protected]</tt></h3>
<p>Returns the current SQL query text, or an empty string if there isn't one.</p>
<p><b>See also </b><a href="qsqlresult.html#setQuery">setQuery</a>().</p>
<!-- @@@lastQuery -->
<!-- $$$numRowsAffected[overload1]$$$numRowsAffected -->
<h3 class="fn"><a name="numRowsAffected"></a><span class="type">int</span> QSqlResult::<span class="name">numRowsAffected</span> ()<tt> [pure virtual protected]</tt></h3>
<p>Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or if the query is a <tt>SELECT</tt> statement.</p>
<p><b>See also </b><a href="qsqlresult.html#size">size</a>().</p>
<!-- @@@numRowsAffected -->
<!-- $$$prepare[overload1]$$$prepareconstQString& -->
<h3 class="fn"><a name="prepare"></a><span class="type">bool</span> QSqlResult::<span class="name">prepare</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>query</i> )<tt> [virtual protected]</tt></h3>
<p>Prepares the given <i>query</i> for execution; the query will normally use placeholders so that it can be executed repeatedly. Returns true if the query is prepared successfully; otherwise returns false.</p>
<p><b>See also </b><a href="qsqlresult.html#exec">exec</a>().</p>
<!-- @@@prepare -->
<!-- $$$record[overload1]$$$record -->
<h3 class="fn"><a name="record"></a><span class="type"><a href="qsqlrecord.html">QSqlRecord</a></span> QSqlResult::<span class="name">record</span> () const<tt> [virtual protected]</tt></h3>
<p>Returns the current record if the query is active; otherwise returns an empty <a href="qsqlrecord.html">QSqlRecord</a>.</p>
<p>The default implementation always returns an empty <a href="qsqlrecord.html">QSqlRecord</a>.</p>
<p><b>See also </b><a href="qsqlresult.html#isActive">isActive</a>().</p>
<!-- @@@record -->
<!-- $$$reset[overload1]$$$resetconstQString& -->
<h3 class="fn"><a name="reset"></a><span class="type">bool</span> QSqlResult::<span class="name">reset</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>query</i> )<tt> [pure virtual protected]</tt></h3>
<p>Sets the result to use the SQL statement <i>query</i> for subsequent data retrieval.</p>
<p>Derived classes must reimplement this function and apply the <i>query</i> to the database. This function is only called after the result is set to an inactive state and is positioned before the first record of the new result. Derived classes should return true if the query was successful and ready to be used, or false otherwise.</p>
<p><b>See also </b><a href="qsqlresult.html#setQuery">setQuery</a>().</p>
<!-- @@@reset -->
<!-- $$$savePrepare[overload1]$$$savePrepareconstQString& -->
<h3 class="fn"><a name="savePrepare"></a><span class="type">bool</span> QSqlResult::<span class="name">savePrepare</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>query</i> )<tt> [virtual protected]</tt></h3>
<p>Prepares the given <i>query</i>, using the underlying database functionality where possible. Returns true if the query is prepared successfully; otherwise returns false.</p>
<p><b>See also </b><a href="qsqlresult.html#prepare">prepare</a>().</p>
<!-- @@@savePrepare -->
<!-- $$$setActive[overload1]$$$setActivebool -->
<h3 class="fn"><a name="setActive"></a><span class="type">void</span> QSqlResult::<span class="name">setActive</span> ( <span class="type">bool</span> <i>active</i> )<tt> [virtual protected]</tt></h3>
<p>This function is provided for derived classes to set the internal active state to <i>active</i>.</p>
<p><b>See also </b><a href="qsqlresult.html#isActive">isActive</a>().</p>
<!-- @@@setActive -->
<!-- $$$setAt[overload1]$$$setAtint -->
<h3 class="fn"><a name="setAt"></a><span class="type">void</span> QSqlResult::<span class="name">setAt</span> ( <span class="type">int</span> <i>index</i> )<tt> [virtual protected]</tt></h3>
<p>This function is provided for derived classes to set the internal (zero-based) row position to <i>index</i>.</p>
<p><b>See also </b><a href="qsqlresult.html#at">at</a>().</p>
<!-- @@@setAt -->
<!-- $$$setForwardOnly[overload1]$$$setForwardOnlybool -->
<h3 class="fn"><a name="setForwardOnly"></a><span class="type">void</span> QSqlResult::<span class="name">setForwardOnly</span> ( <span class="type">bool</span> <i>forward</i> )<tt> [virtual protected]</tt></h3>
<p>Sets forward only mode to <i>forward</i>. If <i>forward</i> is true, only <a href="qsqlresult.html#fetchNext">fetchNext</a>() is allowed for navigating the results. Forward only mode needs much less memory since results do not have to be cached. By default, this feature is disabled.</p>
<p>Setting forward only to false is a suggestion to the database engine, which has the final say on whether a result set is forward only or scrollable. <a href="qsqlresult.html#isForwardOnly">isForwardOnly</a>() will always return the correct status of the result set.</p>
<p><b>Note:</b> Calling setForwardOnly after execution of the query will result in unexpected results at best, and crashes at worst.</p>
<p><b>See also </b><a href="qsqlresult.html#isForwardOnly">isForwardOnly</a>(), <a href="qsqlresult.html#fetchNext">fetchNext</a>(), and <a href="qsqlquery.html#setForwardOnly">QSqlQuery::setForwardOnly</a>().</p>
<!-- @@@setForwardOnly -->
<!-- $$$setLastError[overload1]$$$setLastErrorconstQSqlError& -->
<h3 class="fn"><a name="setLastError"></a><span class="type">void</span> QSqlResult::<span class="name">setLastError</span> ( const <span class="type"><a href="qsqlerror.html">QSqlError</a></span> &amp; <i>error</i> )<tt> [virtual protected]</tt></h3>
<p>This function is provided for derived classes to set the last error to <i>error</i>.</p>
<p><b>See also </b><a href="qsqlresult.html#lastError">lastError</a>().</p>
<!-- @@@setLastError -->
<!-- $$$setQuery[overload1]$$$setQueryconstQString& -->
<h3 class="fn"><a name="setQuery"></a><span class="type">void</span> QSqlResult::<span class="name">setQuery</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>query</i> )<tt> [virtual protected]</tt></h3>
<p>Sets the current query for the result to <i>query</i>. You must call <a href="qsqlresult.html#reset">reset</a>() to execute the query on the database.</p>
<p><b>See also </b><a href="qsqlresult.html#reset">reset</a>() and <a href="qsqlresult.html#lastQuery">lastQuery</a>().</p>
<!-- @@@setQuery -->
<!-- $$$setSelect[overload1]$$$setSelectbool -->
<h3 class="fn"><a name="setSelect"></a><span class="type">void</span> QSqlResult::<span class="name">setSelect</span> ( <span class="type">bool</span> <i>select</i> )<tt> [virtual protected]</tt></h3>
<p>This function is provided for derived classes to indicate whether or not the current statement is a SQL <tt>SELECT</tt> statement. The <i>select</i> parameter should be true if the statement is a <tt>SELECT</tt> statement; otherwise it should be false.</p>
<p><b>See also </b><a href="qsqlresult.html#isSelect">isSelect</a>().</p>
<!-- @@@setSelect -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a><span class="type">int</span> QSqlResult::<span class="name">size</span> ()<tt> [pure virtual protected]</tt></h3>
<p>Returns the size of the <tt>SELECT</tt> result, or -1 if it cannot be determined or if the query is not a <tt>SELECT</tt> statement.</p>
<p><b>See also </b><a href="qsqlresult.html#numRowsAffected">numRowsAffected</a>().</p>
<!-- @@@size -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>