src/sql/kernel/qsqlquery.cpp
changeset 7 f7bc934e204c
parent 0 1918ee327afb
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtSql module of the Qt Toolkit.
     7 ** This file is part of the QtSql module of the Qt Toolkit.
     8 **
     8 **
   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