Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why this stored procedure return an empty result?

I have a stored procedure that it works correctly on localhost but when i tried to execute that on my vps server, i give an empty result.

CREATE PROCEDURE `sp_contest_selectContestId`(
IN _uniquetitle VARCHAR(300))
BEGIN
    SELECT `id`
    FROM `contest`
    WHERE 
        `uniquetitle` = _uniquetitle
    LIMIT 0, 1
;END

When i use this part without using procedure with the same data to test, i have not any problem:

SELECT `id`
FROM `contest`
WHERE 
    `uniquetitle` = _uniquetitle
LIMIT 0, 1
like image 244
Hamidreza Avatar asked Jan 26 '26 13:01

Hamidreza


1 Answers

I was using UTF-8 data. My tables was UTF8 but not my database. database was latin_swedish.

I change my database collation to UTF8 and then import my data again. problem solved.

I had to set mydatabase collation to UTF-8 befor insert or import any things.

like image 146
Hamidreza Avatar answered Jan 28 '26 01:01

Hamidreza