简体   繁体   中英

SQLSTATE[HY000]: General error: 2053 when call SP

I am using Laravel 4.2 and am calling a Stored procedure from a database on the server. Locally it works fine, but on the server, using the same DB, it gives error. The call is as follows (I just want to make select):

$result = DB::select('CALL sp_special_prices("'.$codClient.'", "'.$codProduct.'", "'.$quantity.'", "'.$grup.'", "'.$FirmCode.'")');

When running a product listing on the server, it works except for two articles, giving the following error:

Caught exception: SQLSTATE[HY000]: General error: 2053 (SQL: CALL sp_special_prices("C000000", "445706049", "1", "146", "75");) 

I already checked the php versions, and am using 5.6 on both sites. Could it be some special configuration? Is that the DB is the same, the place to call the SP, is that it is different.

If the procedure doesn't return anything, you need to use DB::statement instead of DB::select . If it does return something, you need to use DB::select

If the procedure has variable behaviour (may or may not return data depending on input), I suggest you change the procedure to return some data for all input combinations

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM