【问题标题】:APEX - switch item - modify reportAPEX - 切换项目 - 修改报告
【发布时间】:2018-09-26 08:42:25
【问题描述】:

我有一组开关项(是,否),应该在点击时生成修改后的报告。

简化设置:Button1,动态报告

来自动态报告的 PL/SQL 查询

declare
q_query varchar2(500);
q_select varchar2(500);
q_where varchar2(500);

begin
q_select := 'select Kat1, Kat2, Kat3 from TBL ';

IF :Button1 = '1' THEN
q_where := 'where Kat3=KatXYZ';
END IF;

q_query := q_select||q_where;

return q_query;
end;

仅供参考

  • Kat3 包含字符串
  • KatXYZ 是要搜索的字符串
  • 查询(select ... from ... when Kat3='KatXYZ';)在以下情况下有效 更改为 SQL 而不是 PL/SQL
  • 为 Button1 创建动态事件以刷新更改报告
  • q_where := '其中 Kat3="KatXYZ"';不工作
  • Button1 自定义设置 On 值:1 - Off 值:0

问题:单击开关项“是”时没有任何反应。有什么想法吗?

【问题讨论】:

    标签: sql plsql oracle-apex


    【解决方案1】:

    这个:

    q_where := 'where Kat3=KatXYZ';
    

    表示Kat3 列应该等于名为KatXYZ 的列/参数/函数,而不是字符串 'KatXYZ'

    试试

    q_where := 'where Kat3 = ''KatXYZ''';
    

    q_where := 'where Kat3 = ' || chr(39) || 'KatXYZ' || chr(39);
    

    q_where := q['where Kat3 = 'KatXYZ']'
    

    这些都应该没问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-14
      • 2013-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多