首页 > 解决方案 > 基于选择的返回值

问题描述

我正在尝试使用页面项目 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)

标签: oracleplsqloracle11goracle-apex

解决方案


这可能会有所帮助。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;
/

推荐阅读