How to call output param with yii

i have function code like this.

$custId = Yii::app()->user->name;

 $command = Yii::app()->db->createCommand("declare @transactionNumber nvarchar(11); exec spSetCustomerTransaction '$custId', @transactionNumber output; select @transactionNumber = TransactionNumber from CustomerTransactions where TransactionNumber = @transactionNumber");


            echo @transactionNumber;

this code run succesfull but i can’t call result output parameter in my view.

how i call or echo this output??



If for example your function is called "myFunction", you could do this:

1- Your function:

function myFunction()



    return @transactionNumber;



2- Into your view:


echo myFunction();