Osama Alvi
Osama Alvi

Reputation: 679

Laravel sql server execute stored procedure with array parameter

I have a very simple question; I have a query running perfectly on sql server and I want to run this query using laravel framework, here is the query:

DECLARE @countries AS countryList; 
    INSERT INTO @countries SELECT countries.id FROM countries where countries.id in (1,2,3,4,9,11,14);
    EXEC sp_positionofCourtCasesofLoanDefaultA @countries

in Laravel this is returning 'true' always

 $result = DB::statement('DECLARE @countries AS countryList; INSERT INTO @countries SELECT countries.id FROM countries where countries.id in (' . $countries . ');
 EXEC sp_positionofCourtCasesofLoanDefaultA @countries');

 dd($result);

please help.

Upvotes: 1

Views: 616

Answers (1)

Valen D'souza
Valen D'souza

Reputation: 11

i think DB:statement() returns either true or false. It is generally used in queries like insert in which no result is returned. So if the query was executed successfully it returns true otherwise returns false.

Upvotes: 1

Related Questions