Reputation: 6038
delimiter //
create procedure ProductViewAllByName(p_productName longtext)
begin
select productId as 'Product Code',
productName as 'Name',
productGroupId as 'Group ID',
manufactureId as 'Manufacture ID',
stockMinimunLevel as 'Stock Minimum Level',
stockMaximimLevel as 'Stock Maximum Level',
description as 'Description',
unitId as 'Unit ID'
FROM tbl_Product
where productName like p_productName+'%' ;
end //
delimiter ;
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ '%' ; end' at line 12
Upvotes: 0
Views: 99
Reputation: 2852
replace where condition with:
where productName like CONCAT(p_productName, '%')
Upvotes: 1
Reputation: 302
Maybe you can do it with CONCAT() function
where productName like CONCAT(p_productName , '%');
Upvotes: 1