1
我已經運行下面的查詢,而不問題:ORA-00932 - 預期數量有 -
with Nums (NN) as
(
select 0 as NN
from dual
union all
select NN+1 -- (1)
from Nums
where NN < 30
)
select null as errormsg, trunc(sysdate)-NN as the_date, count(id) as the_count
from Nums
left join
(
SELECT c1.id, trunc(c1.c_date) as c_date
FROM table1 c1
where c1.c_date > trunc(sysdate) - 30
UNION
SELECT c2.id, trunc(c2.c_date)
FROM table2 c2
where c2.c_date > trunc(sysdate) -30
) x1
on x1.c_date = trunc(sysdate)-Nums.NN
group by trunc(sysdate)-Nums.NN
然而,當我嘗試在SSRS一個進程彈出這個使用方法:
procedure pr_do_the_thing (RefCur out sys_refcursor)
is
oops varchar2(100);
begin
open RefCur for
-- see above query --
;
end pr_do_the_thing;
我得到
錯誤():PL/SQL:ORA-00932:不一致的數據類型:預期數量有 -
有什麼想法?就像我上面所說的那樣,作爲查詢,沒有問題。作爲一個proc,錯誤出現在note(1)int eh查詢中。