I am sure that it returns columns if the in_searchQuery parameter has a match.
Since you are not using any in_searchQuery for partial searches, if it does not find an exact match, no rows will be returned for the in_searchQuery value. For a partial match, you need to use the wildcard symbol '%' with the value in_searchQuery .
The modified procedure should look like this:
DROP PROCEDURE IF EXISTS SearchAlgemeenSet; Delimiter // CREATE PROCEDURE SearchAlgemeenSet(IN in_searchQuery VARCHAR(255)) BEGIN set @search_criteria := concat( '%', in_searchQuery, '%' ); SELECT Blokken, Jaargang, Werk_Uren FROM algemeensets WHERE Blokken LIKE @search_criteria OR Jaargang LIKE @search_criteria OR Werk_Uren LIKE @search_criteria; END; // Delimiter ;
If there are no matches in the search criteria and an empty set will be returned.
In your scripting language, you should check in advance whether the procedure returned any results or not. Based on this, you can show a message that the data was not found or you can perform other actions.
source share