SQLSTATE[HY000]: General error: 2053 when do I call a Stored Procedure?

Asked

Viewed 781 times

0

I’m using Laravel 4.2 and I’m calling one Stored Procedure of a database on the server. Locally everything works fine, but on the server, using the same BD, gives error.

The call is as follows:

$result = DB::select('CALL sp_precos_especiais("'.$codigocliente.'", 
                     "'.$codigoartigo.'", "'.$quantidade.'", 
                     "'.$grupo_produto.'", "'.$FirmCode.'")');

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

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

I’ve already checked the versions of PHP, and I’m using 5.6 on both sites. It could be a particular configuration? 'Cause the bank is the same, the place to call the Stored Procedure, is that it’s different.

  • Your SP is to enter data or return (select)?

  • @rray, it is only to fetch data, select

  • 1

    @pc_oc already tried to run it, directly in the bank, with these same parameters, to observe what happens?

  • @Jefersonalmeida, yes and it works. That’s the problem :)

  • @pc_oc vc executed just that CALL sp_precos_especiais("C000000", "445706049", "1", "146", "75"); and with the same database user?

  • @Jefersonalmeida, yes, yes. I think it is related to the product code, because it does not return anything for this product, but locally returns an empty array, and on the server gives error.

  • Error return on server must be related to SQL Mode or other settings. Compare local Mysql SQL MODE and server settings.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.