我尝试在 phpmyadmin 中运行它...结果有些不对劲。我无法弄清楚这里出了什么问题。
DELIMITER ;
create definer=proiect_wd_user@localhost FUNCTION
f_suma(id_s int, price_f double,product_code_n char(255),quantity_b int)
returns double
BEGIN
select price_f into @price_f
from orders_details WHERE (id=id_s)
select quantity_b into @quantity_b
from orders_details WHERE (id=id_s)
set @suma_f=(@price_f*@quantity_b);
RETURN @suma_f;
end ;
Error:
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select quantity_b into @quantity_b
from orders_details WHERE (id=id_s)
set @su' at line 7