如何在APEX Interactive Report SQL中的where子句中附加字符串 [英] How to append a string to where clause in APEX Interactive Report SQL

查看:134
本文介绍了如何在APEX Interactive Report SQL中的where子句中附加字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Apex的新手,正在使用apex 5.1.3.我正在通过sql查询创建一个报表,查询的where子句应该是动态的,需要从另一个表列中获取.在页面加载时,我从表中加载了此条件字符串,并将其设置为页面项:P5_NEW

I am a newbee in Apex and I am using apex 5.1.3. I am creating a report through sql query and where clause of the query should be dynamic which needs be taken from another table column. On page load i loaded this where condition string from table and set that as page item :P5_NEW

我尝试过这样:

从EMPLOYEES中选择*,其中:P5_NEW

页面项:P5_NEW 包含应附加到where子句的字符串.但是顶点抛出错误 ORA-00920:无效的关系运算符.

Page item :P5_NEW contains the string which should be appended to where clause. But apex throws error ORA-00920: invalid relational operator.

有人可以建议我如何在APEX报告查询的where子句后面附加一个字符串吗?

Can some one please advice how I can append a string to where clause in APEX report query?

谢谢

推荐答案

P5_NEW(好吧,为什么不是P5_WHERE?)应该是一个文本字段,其中按Enter时提交"设置为是".它应包含整个WHERE子句,包括WHERE关键字.如果按原样放置,则会出现 ORA-00936缺少表达式错误.

P5_NEW (well, why not P5_WHERE?) should be a Text field with "Submit when Enter pressed" set to YES. It should contain the whole WHERE clause, including the WHERE keyword. If you put it as you did, you'll get the ORA-00936 missing expression error.

查询将如下所示:

select * 
from employees
&P5_WHERE.    --> pay attention! Ampersand (&) followed by field name
              --> followed by a dot (.)

接下来要做什么?什么都没有...运行页面&请享用.如果您输入类似 WHERE department_id = 10进入P5_WHERE字段,然后按Enter键,输出应更改.

What next? Nothing ... run the page & enjoy. If you enter something like WHERE department_id = 10 into the P5_WHERE field and hit Enter key, output should change.

这篇关于如何在APEX Interactive Report SQL中的where子句中附加字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆