Use INSERT INTO...SELECT
insert into products(productname,proddescription,supplier,lastpurchasedate,quantityleft)
select concat('PID',pid,pname),pdesc,psupp,pdate,pquant
Puede omitir la columna productid
si es un AUTO_INCREMENT
columna.
Me preguntaba por qué necesita ejecutar select pid=last_insert_id();
cuando pid
es un IN
parámetro .
ACTUALIZACIÓN 1
DROP PROCEDURE `inserproducts`;
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `inserproducts`
(
pid int,
pname varchar(50),
pdesc varchar(50),
psupp varchar(50),
pdate date,
pquant int
)
begin
insert into products
(productname,
proddescription,
supplier,
lastpurchasedate,
quantityleft)
select concat('PID',pid,pname), pdesc, psupp, pdate, pquant;
select last_insert_id();
end$$
DELIMITER ;