如何在 SQL 报告查询中使用隐藏页面项目而不提交
使用:Oracle ApEx 3.0.1
我有一个 SQL 报表区域,其中包含一个隐藏页面项作为“where 子句”的一部分。我的问题是,根据用户输入的值,我需要将输入的值分配给我的隐藏项,以便可以在我的 SQL 的 where 条件中使用它,但这需要在不实际提交表单的情况下完成。
目前,我可以通过按需流程设置该值,但我的 SQL 仍然没有返回任何值,因为未设置查询中的隐藏页面项(因为页面尚未提交)。
我不确定如何执行此操作,以及实际上是否可以在未提交页面的情况下执行此操作。
Using: Oracle ApEx 3.0.1
I have a SQL report region that contains a hidden page item as part of the "where clause". My problem is, based on a value entered by the user, I need to assign this value entered to my hidden item, so that it can be used within the where condition of my SQL but this would need to be done without actually submitting the form.
At the moment, I can set the value via an on-demand process but my SQL is still not returning any values as the hidden page item within the query is not set (as page has not been submitted).
I am not sure how to do this and whether in actual fact, this is possible to do, without having submitted the page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您使用的是 Apex 3,因此没有动态动作,但这并没有太大阻碍。
我在 apex.oracle.com 上设置了一个示例。要进入工作区,请使用工作区“tompetrusbe”+ apex_demo / demo。
那里有一个动态动作,它也可以完成这项工作,但我已禁用它。
让它发挥作用需要什么:
一个 ajax 回调过程,包含以下行:
为您的报告区域提供一个静态 ID,我将其称为“report_emp”。这样我就可以轻松检索它。
然后需要在页面的javascript区域中调用app进程,然后刷新该区域。同时绑定需要触发此操作的事件。我在这里是通过参数文本字段的 onchange 事件完成的。
在报告的查询中,我使用
where ename like '%'||UPPER(:P2_PAR_ENAME)||'%'
。当您输入(例如)“bl”并退出(以触发 onchange)时,该区域将刷新并被过滤。
您只需要适应您的解决方案:)
Since you are on Apex 3, you don't have dynamic actions, but that doesn't hinder so much.
I've set up an example on apex.oracle.com. To get in the workspace, use workspace 'tompetrusbe' + apex_demo / demo.
There is a dynamic action there, which can do the work too, but i've disabled it.
What you need to make it work:
an ajax callback process, with the following line:
Give your report region a static id, i called mine 'report_emp'. This so i can easily retrieve it.
In the javascript region of the page, you then need to call the app process, and then refresh the region. Also bind the event which needs to trigger this action. I've done it here through the onchange event of the parameter textfield.
In the query of the report i use
where ename like '%'||UPPER(:P2_PAR_ENAME)||'%'
.When you type (for example) 'bl' in, and tab out (to trigger the onchange), the region will refresh and will be filtered.
You'll just need to adapt to your solution :)