Advertisement
Guest User

Untitled

a guest
Sep 29th, 2014
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. CDbException
  2. CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot insert explicit value for identity column in table 'lime_assessments' when IDENTITY_INSERT is set to OFF.. The SQL statement executed was: INSERT INTO [lime_assessments] ([id], [sid], [scope], [gid], [name], [minimum], [maximum], [message], [language]) VALUES (:id, :sid, :scope, :gid, :name, :minimum, :maximum, :message, :language)
  3.  
  4. D:\Apps\2561_BetaSurvey\web\framework\db\CDbCommand.php(358)
  5.  
  6. 346 {
  7.  
  8. 347 if($this->_connection->enableProfiling)
  9.  
  10. 348 Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute');
  11.  
  12. 349
  13.  
  14. 350 $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
  15.  
  16. 351 $message=$e->getMessage();
  17.  
  18. 352 Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.',
  19.  
  20. 353 array('{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
  21.  
  22. 354
  23.  
  24. 355 if(YII_DEBUG)
  25.  
  26. 356 $message.='. The SQL statement executed was: '.$this->getText().$par;
  27.  
  28. 357
  29.  
  30. 358 throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
  31.  
  32. 359 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
  33.  
  34. 360 }
  35.  
  36. 361 }
  37.  
  38. 362
  39.  
  40. 363 /**
  41.  
  42. 364 * Executes the SQL statement and returns query result.
  43.  
  44. 365 * This method is for executing an SQL query that returns result set.
  45.  
  46. 366 * @param array $params input parameters (name=>value) for the SQL execution. This is an alternative
  47.  
  48. 367 * to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing
  49.  
  50. 368 * them in this way can improve the performance. Note that if you pass parameters in this way,
  51.  
  52. 369 * you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa.
  53.  
  54. 370 * Please also note that all values are treated as strings in this case, if you need them to be handled as
  55.  
  56. Stack Trace
  57. #0
  58.  
  59. +
  60.  
  61.  
  62. D:\Apps\2561_BetaSurvey\web\framework\db\CDbCommand.php(1250): CDbCommand->execute(array(":id" => "161", ":sid" => "41366", ":scope" => "T", ":gid" => "8790", ...))
  63.  
  64. 1245 }
  65.  
  66. 1246 }
  67.  
  68. 1247 $sql='INSERT INTO ' . $this->_connection->quoteTableName($table)
  69.  
  70. 1248 . ' (' . implode(', ',$names) . ') VALUES ('
  71.  
  72. 1249 . implode(', ', $placeholders) . ')';
  73.  
  74. 1250 return $this->setText($sql)->execute($params);
  75.  
  76. 1251 }
  77.  
  78. 1252
  79.  
  80. 1253 /**
  81.  
  82. 1254 * Creates and executes an UPDATE SQL statement.
  83.  
  84. 1255 * The method will properly escape the column names and bind the values to be updated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement