oracle - 基于选择的返回值
问题描述
我正在尝试使用页面项目 1 中的动态操作根据在页面项目 1 中选择的内容在页面项目 2 中返回特定值。
所以例如
当 detailspec(这是我的页面项目 1)为“N/A”时,specificationscore(这是我的页面项目 2)应显示“0”
或者当 detailspec(这是我的页面项目 1)为“Surpass”时,specificationscore(这是我的页面项目 2)应该显示“1”
以下是我认为应该使用的示例,但我不确定
eg.
declare
....
If detailspec(pageitem1) = N/A
then return value =0 (in :p5_SPECIFICATIONSCORE(pageitem2)
elseif
detailspec(pageitem1) = surpass
then return value =1 (in :p5_SPECIFICATIONSCORE(pageitem2)
解决方案
这可能会有所帮助。mytest 可以保存从您的函数返回的值,而不是显示该值,只需按照您似乎正在尝试的方式返回它。
declare
value number;
mytest varchar2(20);
begin
mytest := 'what';
case mytest
when 'N/A' then value := 0;
when 'surpass' then value := 1;
else value := 2;
end case;
DBMS_OUTPUT.PUT_LINE('value=' || value);
end;
/
推荐阅读
- html - 从 html 网页获取节点以使用 R 抓取 URL
- java - 迁移 AndroidX 后的错误
- python - Python Pandas:如何在没有 pivot() 的情况下解开?
- php - 如何在 WordPress 的页眉和页脚中插入页面/发布特定脚本?
- visual-studio-code - VSCode 没有在 Jupyter Notebook 中保存更改(除非我运行有更改的单元格)
- java - 有什么方法可以访问子类型方法而不使用泛型进行转换
- android - 内存泄漏或只是缓慢的模拟器?
- spring-boot - 使用 JUNIT5 测试用例处理多个异常
- asp.net-mvc - 从 ADFS 3.0 重定向回来后,asp.net MVC 应用程序上的会话集丢失
- c# - 每隔指定次数将字符串值拆分为数组的更简单方法是什么?