0
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 ;

error

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

1
  • 1
    Use CONCAT() for that Commented Dec 11, 2013 at 8:16

2 Answers 2

1

Maybe you can do it with CONCAT() function

where productName like CONCAT(p_productName , '%');
Sign up to request clarification or add additional context in comments.

Comments

1

replace where condition with:

where productName like CONCAT(p_productName, '%')

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.