我有一个非常简单的问题;我有一个在sql server上运行完美的查询,我想使用laravel框架运行此查询,这里是查询:
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
在Laravel,这回归真实'总是
$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);
请帮忙。
答案 0 :(得分:1)
我认为DB:statement()返回true或false。它通常用于诸如insert之类的查询中,其中不返回任何结果。因此,如果查询成功执行,则返回true,否则返回false。