Hi
I have the following stored procedure:
Code:
CREATE PROCEDURE count_books(IN inSearchString TEXT)
BEGIN
PREPARE statement FROM
"SELECT COUNT(*)
FROM tbl_books as books
INNER JOIN tbl_book_search AS bk_search
ON bk_search.book_id = books.book_id
WHERE MATCH (bk_search.book_title, bk_search.book_desc)
AGAINST (?)";
SET @p1 = inSearchString;
EXECUTE statement USING @p1;
END
I call the procedure using the following statement:
Code:
CALL count_books('flower')
butI keep getting the following error message:
Code:
SQL Error: PROCEDURE count_books can't return a result set in the given context
I am using mySQL 5. Why is it throwing this error message??? Plus there isnt even much info on this error message on the mySQL site!
Any help will be appreciated.
Thanks