简体   繁体   English

SQLSTATE [HY000]:一般错误:调用SP时出现2053

[英]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. 我正在使用Laravel 4.2,并从服务器上的数据库调用存储过程。 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. 我已经检查过php版本,并且在两个站点上都使用5.6。 Could it be some special configuration? 可以是一些特殊的配置吗? Is that the DB is the same, the place to call the SP, is that it is different. DB是否相同,调用SP的位置是否不同。

If the procedure doesn't return anything, you need to use DB::statement instead of DB::select . 如果该过程未返回任何内容,则需要使用DB::statement而不是DB::select If it does return something, you need to use DB::select 如果确实返回了某些内容,则需要使用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 如果该过程具有可变行为(根据输入可能会或可能不会返回数据),建议您更改该过程以为所有输入组合返回一些数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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