首页 > 解决方案 > 运行程序时,用户必须能够在两个参数中的一个参数中输入值,前提是两者不能保持空白

问题描述

在 Oracle Applications R12 中有一个生成报告的并发程序。并发程序有两个参数,比如说 P1 和 P2。

因此要求用户不能将两个参数都留空。用户必须在 P1 或 P2 中输入任何一个值,或两者都输入。

我们怎样才能做到这一点?

标签: oracleoraclereportsoracle-apps

解决方案


我不知道 Oracle 应用程序。但是,看看以下是否有帮助。

如果您正在调用“创建报告”过程(或者,在 Forms 中,这可能是 RUN_REPORT 或类似的内置过程调用),只有在 P1 和 P2 不为空时才这样做。像这样的东西(伪代码)

if P1 is null and P2 is null then
   null;
else
   call the "create report" procedure
end if;

或者,在 Reports Builder(这是可行)中,您可以在After Parameter Form触发器中检查它,例如

begin
  if :p1 is null and :p2 is null then
     raise srw.do_sql_failure;
  end if;
  return true

exception
  when srw.do_sql_failure then
    srw.message(1000, 'Error - both parameters are empty');
    return false;
end;

推荐阅读