Sto usando il server mssql
con yii framework
Ho creato uno stored-procedure
si prega di vedere sotto il codice.SET NOCOUNT ON non funziona su ubuntu
//Call Store procedure to get data
$sql = "EXECUTE IESReportData @assessmentId=:assessmentId, @queId=:queId,@instanceId=:instanceId";
//set database connection and start the yii query builder to be executed.
$connection = Yii::app()->db;
$command = $connection->createCommand($sql);
$command->bindValue(":assessmentId", $assessmentId);
$command->bindValue(":queId", "");
$command->bindValue(":instanceId", "$instanceId");
$Reportresults = $command->queryAll();
Questo funziona bene sotto ubuntu
ambiente ma dà errore sotto sotto windows
ambiente.
Fatal error: Uncaught exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[IMSSP]: The active result for the query contains no fields.
con un po 'di R & D ho scoperto che abbiamo bisogno di SET NOCOUNT ON così ho cambiato sotto dichiarazione
$sql = "SET NOCOUNT ON EXECUTE IESReportData @assessmentId=:assessmentId, @queId=:queId,@instanceId=:instanceId";
Questo funziona bene in window
, ma fornire risultato nullo sotto ubuntu
ambiente.
Per favore aiutatemi.
Perché non mettere 'SET NOCOUNT on' all'interno del proc memorizzato? – Andrew
Grazie Andrew, ho messo "SET NOCOUNT ON" dentro la stored procedure e ora funziona. – Jayson