I have this stored procedure with output parameter [IDUtente]:
ALTER PROCEDURE [dbo].[spGetIDUtente]
@IDUtente int OUTPUT,
@Cognome nvarchar(80),
@Nome nvarchar(50),
@NomeCompleto nvarchar(150),
@CF nvarchar(16)
AS
BEGIN
SET NOCOUNT ON;
SET @IDUtente = NULL
-- Recupero l'IDUtente tramite il suo codice fiscale [CF]
SELECT @IDUtente = IDUtente FROM dbo.Utenti WHERE CF = @CF
How can I call it with Laravel? That's my code:
$id_utente = 0;
$id_utente = DB::select("call spGetIDUtente(?, ?, ?, ?, ?)", [
$id_utente,
$cognome,
$nome,
$nome_completo,
$cf
]);
But it doesn't work, I got this error:
Incorrect syntax near @P1