1

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.

1
  • In SQL server this stored procedure returns records but in laravel it returns boolean. Commented Jul 31, 2017 at 13:47

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.