CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'id'.. The SQL statement executed was: SELECT * FROM (SELECT TOP 100 * FROM (SELECT TOP 200 [lime_survey_444682].[submitdate], [tokentable].[tid], [tokentable].[participant_id], [tokentable].[firstname], [tokentable].[lastname], [tokentable].[email], [tokentable].[emailstatus], [tokentable].[language], [tokentable].[blacklisted], [tokentable].[sent], [tokentable].[remindersent], [tokentable].[remindercount], [tokentable].[completed], [tokentable].[usesleft], [tokentable].[validfrom], [tokentable].[validuntil], [tokentable].[mpid], [tokentable].[attribute_1], [tokentable].[attribute_2], [tokentable].[attribute_3]
FROM [lime_survey_444682]
LEFT JOIN [lime_tokens_444682] [tokentable] ON lime_survey_444682.token=tokentable.token
WHERE lime_survey_444682.id >= :min AND lime_survey_444682.id <= :max
ORDER BY [lime_survey_444682].[id] ASC) as [__inner__] ORDER BY [__inner__].[id] DESC) as [__outer__] ORDER BY [__outer__].[id] ASC

E:\IIS\website\third_party\yiisoft\yii\framework\db\CDbCommand.php(543)

531         {
532             if($this->_connection->enableProfiling)
533                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
534 
535             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
536             $message=$e->getMessage();
537             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
538                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
539 
540             if(YII_DEBUG)
541                 $message.='. The SQL statement executed was: '.$this->getText().$par;
542 
543             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
544                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
545         }
546     }
547 
548     /**
549      * Builds a SQL SELECT statement from the given query specification.
550      * @param array $query the query specification in name-value pairs. The following
551      * query options are supported: {@link select}, {@link distinct}, {@link from},
552      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
553      * {@link limit}, {@link offset} and {@link union}.
554      * @throws CDbException if "from" key is not present in given query parameter
555      * @return string the SQL statement

Stack Trace

#1
+
 E:\IIS\website\application\helpers\admin\exportresults_helper.php(118): CDbCommand->query()
113         for ($i = 0; $i < $maxPages; $i++) {
114             $offset = $i * $maxRows;
115             $responsesQuery = $surveyDao->loadSurveyResults($survey, $oOptions->responseMinRecord, $oOptions->responseMaxRecord, $sFilter, $oOptions->responseCompletionState, $oOptions->selectedColumns, $oOptions->aResponses);
116             $responsesQuery->offset($offset);
117             $responsesQuery->limit($maxRows);
118             $survey->responses = $responsesQuery->query();
119             $writer->write($survey, $sLanguageCode, $oOptions, true);
120         }
121         $result = $writer->close();
122 
123         // Close resultset if needed
#2
+
 E:\IIS\website\application\controllers\admin\Export.php(359): ExportSurveyResultsService->exportResponses("444682", "en", "csv", FormattingOptions, ...)
354         } else {
355             $sFilter = '';
356         }
357 
358         viewHelper::disableHtmlLogging();
359         $resultsService->exportResponses($iSurveyID, $explang, $sExportType, $options, $sFilter);
360 
361         Yii::app()->end();
362     }
363 
364     /**
#5
+
 E:\IIS\website\application\core\SurveyCommonAction.php(83): CAction->runWithParamsInternal(Export, ReflectionMethod, array("r" => "admin/export/sa/exportresults/surveyid/444682", "sa" => "exportresults", "surveyid" => "444682", "iSurveyId" => "444682", ...))
78             $oMethod = new ReflectionMethod($this, $sDefault);
79         }
80 
81         // We're all good to go, let's execute it
82         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
83         return parent::runWithParamsInternal($this, $oMethod, $params);
84     }
85 
86     /**
87      * Some functions have different parameters, which are just an alias of the
88      * usual parameters we're getting in the url. This function just populates
2022-10-13 16:50:48 Microsoft-IIS/10.0 Yii Framework/1.1.26-dev