我正在执行 sql server 存储过程,在输出中,当我从 Sql Server 管理工作室执行它时,我得到两件事结果和消息。但是我不知道在执行存储过程时如何在 zend 框架 2 中获取该消息?
class myController{
public function indexAction() {
$getResource = $this->fetchTransStatus('123');
$obj = sqlsrv_fetch_array($getResource, SQLSRV_FETCH_ASSOC);
// $obj will give the result coming from database,
// but i am not getting the message coming from stored procedure
// which i it is sending through RAISERROR
}
public function fetchTransStatus($data = null)
{
$procedure = 'procedure_name';
$params = " @param1 = $data, @param2 = 1";
$stmt = $this->tableGateway->getAdapter()->createStatement();
$stmt->prepare("EXEC $procedure $params");
$result = $stmt->execute();
return $result->getResource();
}
}
我将如何获得来自 zend 框架 2 中存储过程的 RAISERROR 消息?