CREATE DEFINER=`newuser`@`localhost` PROCEDURE `spSelectAllCustomers`(
IN customRole VARCHAR(30))
BEGIN
IF customRole IS NULL THEN
SELECT * FROM db.Customers AS c;
ELSE
SELECT customRole FROM db.Customers AS c;
END IF;
END
call db.spSelectAllCustomers('UPPER(c.CustomerName)');
SELECT UPPER(c.Name) FROM Customers AS c; i want to run this query but i want to pass UPPER(c.Name) as a parameter like SELECT customRole FROM Customers AS c;
I'm trying to send UPPER(c.Name) as argument but compiler is treating it as varchar and returning 'UPPER(c.Name)' for every row of the column 'Name'