CREATE DEFINER = 'Test'@'%'
PROCEDURE Test.stockList(p_stockName varchar(25))
BEGIN
CREATE TEMPORARY TABLE StockList
( ID int
,Name varchar(200)
,Price decimal(18,2)
);
INSERT INTO StockList(ID, Name,Price)
VALUES (1,'Rel',2200.00);
INSERT INTO StockList(ID, Name,Price)
VALUES (2,'Relaxo',650.00);
INSERT INTO StockList(ID, Name,Price)
VALUES (3,'TCS',2150.00);
IF p_stockName='Rel' THEN
UPDATE StockList
SET Price=2100.00
WHERE StockList.Name='Rel';
ELSEIF p_stockName='TCS' THEN
UPDATE StockList
SET Price=2200.00
WHERE StockList.Name='TCS';
ELSE
UPDATE StockList
SET Price=750.00
WHERE StockList.Name='Relaxo';
END IF;
SELECT * FROM StockList;
END