我正在尝试创建一个程序来计算一些利率价格等。这里有一点摘录。
但是,我收到一条错误消息:检查 'call due_form( in amtDue double, in extPrice double '
变量是否不在正确的范围内?可能是什么问题?任何建议表示赞赏。
create procedure due_form(in amtDue double
, in extPrice double
, in discAmt double
, in discPrice double
, in p_taxRate double
, out p_msg varchar(255))
begin
set p_msg := concat(
'Amount Due ' , amtDue , '\n'
, 'Ext Price ', extPrice, '\n'
, 'Disc Amount ', discAmt, '\n'
, 'After Discount ', discPrice, '\n'
, 'Sales Tax ', p_taxRate);
end;
#
create procedure due( in p_price double
, in p_quantity integer
, in p_discRate double
, in p_taxRate double
, in p_shipping double
, out p_amtDue double
, out p_msg varchar(255) )
begin
declare extPrice double;
declare discAmt double;
declare discPrice double;
declare amtDue double;
declare msg varchar(255);
select p_price, p_quantity, p_discRate, p_taxRate, p_shipping;
set extPrice := p_price * p_quantity;
set discAmt := extPrice * p_discRate;
set discPrice := extPrice - discAmt;
set amtDue:= discPrice * p_taxRate + p_shipping;
set p_amtDue := amtDue;
set msg := call due_form( in amtDue double
, in extPrice double
, in discAmt double
, in discPrice double
, in p_taxRate double
, out p_msg varchar(255) )
set p_msg := msg;
select p_msg;
结尾;