我在 oracle 中创建了一个过程,如下所示:
create or replace PROCEDURE SP_X_AVERAGE
(
profile out SYS_REFCURSOR,
rx out SYS_REFCURSOR,
)
as
BEGIN
open profile for
select
avg(to_number(profile_netassets)) AS netassets
from
fgp;
open rx for
select
avg(to_number(a_price)) as twr
from
r_x
where
gq_date <= add_months(to_date(sysdate, 'mm/dd/yyyy'), -12);
END SP_X_AVERAGE;
它没有运行,出现以下错误:
ORA-01843: not a valid month
如果我删除第二个 sql 中的 where 条件,那么它会成功运行。
在同一过程中使用 sql 更改会话也不起作用。
请帮忙。
我在 sql-developer (ubuntu Oneiric 11) 中运行这个程序