我正在运行此程序,根据插入的天数计算总价。
CREATE OR REPLACE PROCEDURE calcTotal
(p_checkInDate IN STAYRECORD.checkInDate%TYPE,
p_checkOutDate IN STAYRECORD.checkOutDate%TYPE,
p_cageNo IN STAYRECORD.cageNo%TYPE,
p_total OUT number)
AS
p_price float;
BEGIN
select price into p_price
from cage
where cageNo = p_cageNo;
p_total := 'select (to_date(p_checkOutDate, 'dd/mm/yyyy')-to_date(p_checkInDate, 'dd/mm/yyyy')) * p_price'||
'from dual';
END;
/
每当我把'dd-mm-yyyy'该过程是使用compilcation错误创建的
'遇到符号" DD"'。
为什么会这样?