I am trying to execute MSSQL procedure name "AppointmentCancel" but “Invalid parameter number: parameter was not defined” error is returned
Here is my code
$rc = null;
$db = Yii::app()->db;
$command = $db->createCommand('exec :rc = AppointmentCancel :appointment_id, :reason, :comments');
$command->bindValue(':appointment_id', $apptID, SQLINT4);
$command->bindValue(':reason', $reason, SQLVARCHAR);
$command->bindValue(':comments', $comments, SQLVARCHAR);
$command->bindParam(':rc', $rc, SQLINT4);
$rows = $command->queryAll();
What is wrong with this code? could you please help. thanks in advance