我刚开始使用 Oracle BI Publisher,我真的不知道如何处理我的任务。
我的项目是向用户询问一个参数(没关系),如果用户选择 01,我应该只显示“一月”和一些数据。如果用户选择 03,我应该显示 3 列,“一月”“二月”“三月”,每列都有一些数据。
直到 12 月我都有所有的列,我只是不知道如何根据给定的参数选择不同数量的列。
编辑,添加代码!
declare
p SYS_REFCURSOR;
begin
if (:month)=02 then
open p for select 'bazisev' as evtipus, month-1 as month, january, february
from db.tablename where month=(:month)-1 and sorszam between 4 and 15
union all
select 'targyev' as evtipus, month, january, february
from db.tablename where month=(:month) and sorszam between 4 and 15
union all
select 'targyev/bazisev' as evtipus, month, january, february
from db.tablename where month=(:month) and sorszam between 32 and 39
order by sorszam;
elsif (:month)=01 then
open p for select 'bazisev' as evtipus, month-1 as month, january
from db.tablename where month=(:month)-1 and sorszam between 4 and 15
union all
select 'targyev' as evtipus, month, january
from db.tablename where month=(:month) and sorszam between 4 and 15
union all
select 'targyev/bazisev' as evtipus, month, january
from db.tablename where month=(:month) and sorszam between 32 and 39
order by sorszam;
end if;
end
所以现在我这样做了 2 个月,但它说:ORA-00907:缺少右括号
我很确定我有我需要的所有括号。有什么建议吗?