我有 oracle 查询我想比较两个日期它工作正常但是当我把它放在 oracle 函数中并将日期作为参数传递时我得到这个错误:
ORA-01843: not a valid month
ORA-06512: at line 8
Process exited.
这是我的功能:
Create or Replace
FUNCTION GET_MAX_VALUE
(
PLAN_DATE IN DATE
, LOC IN NUMBER
, RES IN NUMBER
, TIS IN NUMBER
) RETURN NUMBER AS
units number;
return_val number;
BEGIN
select ts.booked_units into units from tsm_transaction_tbl ts
where ts.location_id=loc and ts.resource_id=res and ts.ts_id=tis and ts.trans_date=to_date(plan_date,'mm/dd/yyyy');
RETURN units;
END GET_MAX_VALUE;