CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[07002]: [Microsoft][SQL Server Native Client 11.0]COUNT field incorrect or syntax error. The SQL statement executed was: DELETE FROM [dbo].[lime_questions] WHERE qid = :qid or parent_qid = :qid

C:\etc\Apache\htdocs\MSSQL\framework\db\CDbCommand.php(354)

342             return $n;
343         }
344         catch(Exception $e)
345         {
346             if($this->_connection->enableProfiling)
347                 Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().')','system.db.CDbCommand.execute');
348             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
349             $message = $e->getMessage();
350             Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.',
351                 array('{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
352             if(YII_DEBUG)
353                 $message .= '. The SQL statement executed was: '.$this->getText().$par;
354             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
355                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
356         }
357     }
358 
359     /**
360      * Executes the SQL statement and returns query result.
361      * This method is for executing an SQL query that returns result set.
362      * @param array $params input parameters (name=>value) for the SQL execution. This is an alternative
363      * to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing
364      * them in this way can improve the performance. Note that if you pass parameters in this way,
365      * you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa.
366      * binding methods and  the input parameters this way can improve the performance.

Stack Trace

#1
+
 C:\etc\Apache\htdocs\MSSQL\application\controllers\admin\question.php(889): CActiveRecord->deleteAll(CDbCriteria)
884                 Answers::model()->deleteAllByAttributes(array('qid' => $qid));
885 
886                 $criteria = new CDbCriteria;
887                 $criteria->addCondition('qid = :qid or parent_qid = :qid');
888                 $criteria->params[':qid'] = $qid;
889                 Questions::model()->deleteAll($criteria);
890 
891                 Defaultvalues::model()->deleteAllByAttributes(array('qid' => $qid));
892                 Quota_members::model()->deleteAllByAttributes(array('qid' => $qid));
893 
894                 Questions::updateQuestionOrder($gid, $surveyid);
#4
+
 C:\etc\Apache\htdocs\MSSQL\application\core\Survey_Common_Action.php(82): CAction->runWithParamsInternal(question, ReflectionMethod, array("surveyid" => "766173", "gid" => "19", "qid" => "205", "sa" => "delete", ...))
77             $oMethod = new ReflectionMethod($this, $sDefault);
78         }
79 
80         // We're all good to go, let's execute it
81         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
82         return parent::runWithParamsInternal($this, $oMethod, $params);
83     }
84 
85     /**
86     * Some functions have different parameters, which are just an alias of the
87     * usual parameters we're getting in the url. This function just populates
#8
+
 C:\etc\Apache\htdocs\MSSQL\application\controllers\AdminController.php(158): CController->run("question")
153                 Yii::app()->session['redirectopage'] = Yii::app()->request->requestUri;
154 
155                 $this->redirect($this->createUrl('/admin/authentication/login'));
156             }
157 
158             return parent::run($action);
159     }
160 
161     /**
162     * Routes all the actions to their respective places
163     *
2012-10-24 12:12:34 Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 Yii Framework/1.1.10