如何从下拉选择框中引用值...?
我正在使用 Oracle APEX 并且正在生成交互式报告..现在我有一个下拉选择框,其中包含值列表 (LOV)..我想要做的是使用下拉列表中当前选择的值用于生成交互式报告的 SQL 查询中的下拉框。例如,这是用于生成交互式报告的 SQL 查询,仅显示具有销售员级别的员工:
select "EMP"."EMPNO" as "EMPNO",
"EMP"."ENAME" as "ENAME",
"EMP"."RANK" as "RANK",
from "EMP" "EMP"
where "EMP"."RANK" = 'SALESMAN'
上面的查询完全适合我...现在我有一个APEX 中同一页面上的下拉框是名为 RANKS,并且具有以下 LOV:销售员、职员、会计、部门主管
如何更改 SQL 查询,以便它现在在等级下拉列表中查找当前选定的等级,然后仅显示具有该等级的员工...
I'm using Oracle APEX and I'm generating an interactive report .. Now I have a drop down selection box which has a list of values (LOVs) .. What I want to do is to use the currently selected value in the drop down box in the SQL query being used to generate the interactive report .. Like for example this is the SQL query for generating the interactive report to only show employees with rank Salesman:
select "EMP"."EMPNO" as "EMPNO",
"EMP"."ENAME" as "ENAME",
"EMP"."RANK" as "RANK",
from "EMP" "EMP"
where "EMP"."RANK" = 'SALESMAN'
The above query completely works for me ... Now I have a drop down box on the same page in APEX which is named RANKS, and has this LOV: SALESMAN, CLERK, ACCOUNTANT, DEPTHEAD
How do I change the SQL Query so that it now looks up the currently selected rank in the ranks drop down list and then only displays employees with that rank ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
例如,如果您的等级 LOV 称为 P1_RANKS,则您可以将查询 SQL 更改为:
但是,只有在选择等级后才有效。如果要在未选择级别时显示所有员工,请执行以下操作:
您可以使选择列表提交页面以刷新报表,或者最好创建动态操作以在选择列表项更改时刷新报表。
If your ranks LOV is called P1_RANKS for example, then you can change the query SQL to:
However, that only works once a rank has been selected. If you want to show all employees when no rank has been selected do this:
You can either make the select list submit the page to refresh the report or, preferably, create a dynamic action to refresh the report when the select list item is changed.