1
I need to run an SQL (SQL SERVER) execution block on a Repository in Doctrine. My environment is with ZF2 + Doctrine 2. I’ve read some things about ResultSetMapping
in Doctrine, but I couldn’t.
Code:
public function teste() {
$connection = $this->_em->getConnection();
$sql = "DECLARE @Test AS dbo.DataTempTransactions;
INSERT INTO @Test VALUES ('015.004.000',100,'015A')
DECLARE @DATE datetime
SET @DATE = GETDATE()
EXEC ONCode.dbo.TmSp_Exit @Test, @mnfdate = @DATE
SELECT * FROM ONTest.dbo.OBTN";
$stmt = $connection->prepare($sql);
return $stmt->execute();
}
I am using in the block of an execution a Type defined by the user - dbo.DataTempTransactions
- (Use Table-Valued Parameters (Database Engine)), I don’t know if it influences anything.
Thanks in advance.