src/sql/drivers/odbc/qsql_odbc.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 7 3f74d0d4af4c
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     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 **
   886     QByteArray query8 = query.toLocal8Bit();
   886     QByteArray query8 = query.toLocal8Bit();
   887     r = SQLExecDirect(d->hStmt,
   887     r = SQLExecDirect(d->hStmt,
   888                        (SQLCHAR*) query8.constData(),
   888                        (SQLCHAR*) query8.constData(),
   889                        (SQLINTEGER) query8.length());
   889                        (SQLINTEGER) query8.length());
   890 #endif
   890 #endif
   891     if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) {
   891     if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO && r!= SQL_NO_DATA) {
   892         setLastError(qMakeError(QCoreApplication::translate("QODBCResult",
   892         setLastError(qMakeError(QCoreApplication::translate("QODBCResult",
   893                      "Unable to execute statement"), QSqlError::StatementError, d));
   893                      "Unable to execute statement"), QSqlError::StatementError, d));
   894         return false;
   894         return false;
       
   895     }
       
   896 
       
   897     if(r == SQL_NO_DATA) {
       
   898         setSelect(false);
       
   899         return true;
   895     }
   900     }
   896 
   901 
   897     SQLINTEGER isScrollable, bufferLength;
   902     SQLINTEGER isScrollable, bufferLength;
   898     r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength);
   903     r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength);
   899     if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
   904     if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)