I have already created a SQL Store Produced like this:
USE [xxx]
GO
/****** Object: StoredProcedure [dbo].[ResultsByRegionAndDate] Script Date: 02/25/2016 14:29:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[ResultsByRegionAndDate]
@Region VARCHAR(10),
@DayD DATETIME,
@DaySpin DATETIME OUTPUT
AS
BEGIN
/* logic here */
END
And now, in my Laravel project, althought I've tried many way to get output on stored produce but still fail.
$region = 'BAC';
$ngay = '2016-02-25';
$pdo = DB::connection()->getPdo();
$stmt = $pdo->prepare('DECLARE @DaySpin datetime EXEC dbo.ResultsByRegionAndDate ?, ?, @DaySpin');
$stmt->bindParam(1, $region);
$stmt->bindParam(2, $ngay);
$stmt->bindParam(3, $out);
$stmt->execute();
$search = array();
do {
$search = $stmt->fetchAll(PDO::FETCH_ASSOC);
} while ($stmt->nextRowset());
return $out; // to see the result
When code is running, $out
is empty, I don't know how to get output from stored product.
Are there any way to get output without modify stored produce?
Please help