我有一组开关项目(是,否(,单击时应该会导致修改报告。
简化设置:按钮 1,动态报告
从动态报表进行 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 是要搜索的字符串
- 查询(选择...从。。。当 Kat3='KatXYZ';)工作时 更改为 SQL 而不是 PL/SQL
- 为 Button1 创建的动态事件以刷新更改报告
- q_where := 'where Kat3="KatXYZ"';不起作用
- 按钮 1 自定义设置 打开值:1 - 关闭值:0
问题:单击开关项"是"时没有任何反应。有什么想法吗?
这个:
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']'
其中任何一个都应该没问题。