oracle - 运行程序时,用户必须能够在两个参数中的一个参数中输入值,前提是两者不能保持空白
问题描述
在 Oracle Applications R12 中有一个生成报告的并发程序。并发程序有两个参数,比如说 P1 和 P2。
因此要求用户不能将两个参数都留空。用户必须在 P1 或 P2 中输入任何一个值,或两者都输入。
我们怎样才能做到这一点?
解决方案
我不知道 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;
推荐阅读
- mysql - 将文字属性续集为布尔值
- python - 并排放置 2 个变量的 ACF 图
- visual-studio-code - 有没有办法让 VSCode Intellisense 建议在分号之外结束?
- angular - Angular:添加 Swagger UI
- javascript - 如何从 JavaScript 中的对象中获取变量的值?
- sql - 在 Oracle 查询中将连接从 Where 子句移动到 From 子句
- python - C# 从命令行 powershell 运行 python 脚本及其嵌入在资源中的依赖项
- sorting - 根据多年表中的当年销售额对结果进行排序并创建排名列 SSRS
- python - 当我提交时,图像字段在 django 中被清除
- wpf - 使用 MahApps.Metro 主题覆盖 Expander ToggleButton 样式