我想做这样的事情:
Quantity Price Payment
1 12 12.00
这是我的代码:
CREATE DEFINER=`root`@`localhost`
PROCEDURE `insertproducts`
(
pname varchar(50),
pdesc varchar(50),
psupp varchar(50),
pdate date,
pquant int,
pprice double
)
begin
insert into products
(
prodname,
proddescription,
prodsupplier,
proddate,
prodquantity,
prodprice,
prodpayment
)
values
(
pname,
pdesc,
psupp,
pdate,
pquant,
pprice,
ppayment
)
set prodpayment = pprice * prodquantity;
end
这不起作用,有什么想法吗?