我创建了一个 PL/SQL 过程,如下所示:https://dba.stackexchange.com/questions/45016/dynamic-oracle-pivot-in-clause
现在我想使用该过程作为报告的来源。我正在使用 Oracle Apex 4.0。
当我这样写时:
Declare
x refcursor;
begin
dynamic_pivot(x);
end;
出现以下错误:
ORA-20001: Query must begin with SELECT or WITH
但是,可以使用过程作为源,如下所述: Calling procedure in oracle apex
最佳答案
您不能使用 PL/SQL 过程作为交互式报告的源。 您可以做的是创建一个在 SELECT 查询中使用的函数。 例如:
SELECT * FROM TABLE YOUR_FUNCTION(PARM1,PARM2);
定义可能如下所示:
create or replace function your_function
(
PARM1 in integer,
PARM2 in integer
)
return holiday_tab pipelined
as
v_easter_day date;
begin
...
end;
有关管道的更多信息,请查看: http://docs.oracle.com/cd/B28359_01/appdev.111/b28425/pipe_paral_tbl.htm#CHDJEGHC
关于oracle - 调用Oracle APEX过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32539319/