src/sql/kernel/qsqlquery.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
equal deleted inserted replaced
18:2f34d5167611 19:fcece45ef507
   820   Setting forward only to false is a suggestion to the database engine,
   820   Setting forward only to false is a suggestion to the database engine,
   821   which has the final say on whether a result set is forward only or
   821   which has the final say on whether a result set is forward only or
   822   scrollable. isForwardOnly() will always return the correct status of
   822   scrollable. isForwardOnly() will always return the correct status of
   823   the result set.
   823   the result set.
   824 
   824 
       
   825   \note Calling setForwardOnly after execution of the query will result
       
   826   in unexpected results at best, and crashes at worst.
       
   827 
   825   \sa isForwardOnly(), next(), seek(), QSqlResult::setForwardOnly()
   828   \sa isForwardOnly(), next(), seek(), QSqlResult::setForwardOnly()
   826 */
   829 */
   827 void QSqlQuery::setForwardOnly(bool forward)
   830 void QSqlQuery::setForwardOnly(bool forward)
   828 {
   831 {
   829     d->sqlResult->setForwardOnly(forward);
   832     d->sqlResult->setForwardOnly(forward);
   997   Set the placeholder \a placeholder to be bound to value \a val in
  1000   Set the placeholder \a placeholder to be bound to value \a val in
   998   the prepared statement. Note that the placeholder mark (e.g \c{:})
  1001   the prepared statement. Note that the placeholder mark (e.g \c{:})
   999   must be included when specifying the placeholder name. If \a
  1002   must be included when specifying the placeholder name. If \a
  1000   paramType is QSql::Out or QSql::InOut, the placeholder will be
  1003   paramType is QSql::Out or QSql::InOut, the placeholder will be
  1001   overwritten with data from the database after the exec() call.
  1004   overwritten with data from the database after the exec() call.
       
  1005   In this case, sufficient space must be pre-allocated to store
       
  1006   the result into.
  1002 
  1007 
  1003   To bind a NULL value, use a null QVariant; for example, use
  1008   To bind a NULL value, use a null QVariant; for example, use
  1004   \c {QVariant(QVariant::String)} if you are binding a string.
  1009   \c {QVariant(QVariant::String)} if you are binding a string.
       
  1010 
       
  1011   Values cannot be bound to multiple locations in the query, eg:
       
  1012   \code
       
  1013   INSERT INTO testtable (id, name, samename) VALUES (:id, :name, :name)
       
  1014   \endcode
       
  1015   Binding to name will bind to the first :name, but not the second.
  1005 
  1016 
  1006   \sa addBindValue(), prepare(), exec(), boundValue() boundValues()
  1017   \sa addBindValue(), prepare(), exec(), boundValue() boundValues()
  1007 */
  1018 */
  1008 void QSqlQuery::bindValue(const QString& placeholder, const QVariant& val,
  1019 void QSqlQuery::bindValue(const QString& placeholder, const QVariant& val,
  1009                           QSql::ParamType paramType
  1020                           QSql::ParamType paramType