前面有提到过5分钟就可以做好一个查询页面,这个是ORACLE APEX比较牛逼的功能!
但是实际情况可能是:
-
1:查询比较复杂的业务,往往有上十几张表之间的关联,如果用标准功能,查询很慢,性能会有影响!
-
2:查询条件对用户不够友好,
-
3:当查询条件有lov, 子查询的时候很难实现
那么我们就会需要先摆好的条件,并给他们做好lov,多选等等定制! 点查询按钮,在交互式网格或者交互式报表中显示结果!
场景:查询EMP表,
需要:按照查询条件1:部门可以多选 2:指定薪水范围,3指定职务的组合查询
我们先来看看效果
那么我们是怎么实现的呢?分以下几个步骤:
隐藏内容
此处内容需要权限查看
会员免费查看这样,我们一个自定义查询条件的查询就做完了,完全达到了上面的效果,符合预期
付上用到的table和数据!
create table TTIAPEX.EMP ( empno NUMBER(4) not null, ename VARCHAR2(10), job VARCHAR2(9), mgr NUMBER(4), hiredate DATE, sal NUMBER(7,2), comm NUMBER(7,2), deptno NUMBER(2) ) insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7839, null, 'CLERK', null, null, null, null, null); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7698, 'BLAKE', 'MANAGER', 7839, to_date('01-05-1981', 'dd-mm-yyyy'), 2850, null, 30); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7782, 'CLARK', 'MANAGER', 7839, to_date('09-06-1981', 'dd-mm-yyyy'), 2450, null, 10); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7566, 'JONES', 'MANAGER', 7839, to_date('02-04-1981', 'dd-mm-yyyy'), 2975, null, 20); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7788, 'SCOTT', 'ANALYST', 7566, to_date('09-12-1982', 'dd-mm-yyyy'), 3000, null, 20); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7902, 'FORD', 'ANALYST', 7566, to_date('03-12-1981', 'dd-mm-yyyy'), 3000, null, 20); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7369, 'SMITH', 'CLERK', 7902, to_date('17-12-1980', 'dd-mm-yyyy'), 800, null, 20); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7499, 'ALLEN', 'SALESMAN', 7698, to_date('20-02-1981', 'dd-mm-yyyy'), 1600, 300, 30); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7521, 'WARD', 'SALESMAN', 7698, to_date('22-02-1981', 'dd-mm-yyyy'), 1250, 500, 30); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7654, 'MARTIN', 'SALESMAN', 7698, to_date('28-09-1981', 'dd-mm-yyyy'), 1250, 1400, 30); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7844, 'TURNER', 'SALESMAN', 7698, to_date('08-09-1981', 'dd-mm-yyyy'), 1500, 0, 30); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7876, 'ADAMS', 'CLERK', 7788, to_date('12-01-1983', 'dd-mm-yyyy'), 1100, null, 20); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7900, 'JAMES', 'CLERK', 7698, to_date('03-12-1981', 'dd-mm-yyyy'), 950, null, 30); insert into TTIAPEX.EMP (empno, ename, job, mgr, hiredate, sal, comm, deptno) values (7934, 'MILLER', 'CLERK', 7782, to_date('23-01-1982', 'dd-mm-yyyy'), 1300, null, 10); commit;
主题授权提示:请在后台主题设置-主题授权-激活主题的正版授权,授权购买:RiTheme官网
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。