Example is given for Pre-Query and Post-Query triggers in Oracle Forms, with using Display_Itembuilt-in in Post-Query triggers to highlight fields dynamically.
 
This is the screen shot below for this example:
 

You can also download this form from the following link: Query.fmb
 
The example is based on HR schema departments table. In this example Department No. and Execute Query push button is in upper block named "Ctrl" block and below block is the departments block. User will be asked to enter department no. in above block and then to click on Execute Query button to filter the records below. The filtration is handled in Pre-Query trigger and after execution of query the Manager Name and Salary will be populated in Post-Query trigger by dynamically highlighting the Manager Name using Display_Item built-in.
 
The following code written in Pre-Query trigger of Departments block to filter the records:
 
if :ctrl.deptno is not null then
  -- set default_where property of the block to the ctrl block item to filter the records before query
  set_block_property('departments', default_where, 'department_id = :ctrl.deptno');
end if;

The following code written in Post-Query trigger of Departments block to populate non-database item fields and dynamically highlighting the Manager Name field:
 
begin
 select first_name, salary into :departments.empname, :departments.sal
   from hr.employees where employee_id = :departments.manager_id;
   -- highlight as per your criteria
   if :sal >= 10000 then
                  -- create highlight visual attribute with color of your choice to highlight
      display_item('departments.empname', 'highlight');
   else
                 -- create default1 visual attribute to restore to normal view
      display_item('departments.empname', 'default1');
   end if;
exception
 when others then
   null;
end;

The following code written in When-Button-Pressed trigger of Execute Query push button in Ctrl block to execute query in Departments block:
 
go_block('departments');
set_block_property('departments', default_where, '');
execute_query;

An Example of Pre-Query and Post-Query Triggers in Oracle Forms With Using Display_Item to Highlight Dynamically的更多相关文章

  1. If Value Exists Then Query Else Allow Create New in Oracle Forms An Example

    An example given below for Oracle Forms, when a value exists then execute query for that value to di ...

  2. Freebie - Utility Form: Generate Excel Report From SQL Query In Oracle Forms 6i And 11g

    Sharing a form to generate Excel file report from SQL query in Oracle Forms. This form can be used i ...

  3. Elasticsearch 5.x 关于term query和match query的认识

    http://blog.csdn.net/yangwenbo214/article/details/54142786 一.基本情况 前言:term query和match query牵扯的东西比较多, ...

  4. Hibernate : Query.list()、Query.iterator()的区别

    Query上有list()与iterator()方法,两者的差别在于list()方法在读取数据时,并不会利用到快取,而是直接再向数据库查询,而iterator()则将读取到的数据写到快取,并于读取时再 ...

  5. Enter Query Mode Search Tricks Using Enter_Query Built-in in Oracle Forms

    In this post you will learn how to specify any condition in enter query mode of Oracle Forms. Whenev ...

  6. Create Data Block Based On From Clause Query In Oracle Forms

    Example is given below to create a data block based on From Clause query in Oracle Forms. The follow ...

  7. query.setFirstResult(0),query.setMaxResults(4)

    query.setFirstResult(0),query.setMaxResults(1);相当于MySQL中的limit 0, 1; String hql = "FROM Forum f ...

  8. 使用Retrofit时出现 java.lang.IllegalArgumentException: URL query string "t={type}&p={page}&size={count}" must not have replace block. For dynamic query parameters use @Query.异常原因

    /** * Created by leo on 16/4/30. */ public interface GanchaiService { @GET("digest?t={type}& ...

  9. dojo 学习笔记之dojo.query - query(id) 与query(class)的差别

    考虑这个样例:动态创建一个页面的时候,用new listtem()生成多个listitem, 且每一个listitem中都生成一个按钮button. 假设想要给每一个按钮都绑定一个click事件,用d ...

  10. Elasticsearch Query DSL备忘(1)(Constant score query和Bool Query)

    Query DSL (Domain Specific Language),基于json的查询方式 1.Constant score query,常量分值查询,目的就是返回指定的score,一般都结合f ...

随机推荐

  1. php防止表单重复提交

    解决方案一:引入cookie机制来解决 提交页面代码如下a.php代码如下: <form id="form1" name="form1" method=& ...

  2. MapReduce之Writable相关类

    当要在进程间传递对象或持久化对象的时候,就需要序列化对象成字节流,反之当要将接收到或从磁盘读取的字节流转换为对象,就要进行反序列化.Writable是Hadoop的序列化格式,Hadoop定义了这样一 ...

  3. 如何对HashMap按键值排序

    Java中HashMap是一种用于存储“键”和“值”信息对的数据结构.不同于Array.ArrayList和LinkedLists,它不会维持插入元素的顺序. 因此,在键或值的基础上排序HashMap ...

  4. Openstack的ping不通实例的解决办法

    状态:实例在管理平台上正常创建,也能vnc到实例里面使用ifconfig,查看IP得到我们想要的IP,但是在除了计算节点以外的机器ping实例就是不通. 操作:主要为了测试网络51删除,重新创建网络5 ...

  5. Java 基本数据类型 sizeof 功能【转】

    转自:http://blog.csdn.net/sunboy_2050/article/details/7310008 版权声明:本文为博主原创文章,未经博主允许不得转载. Java基本数据类型int ...

  6. Understanding the RelationshipType Enumeration [AX 2012]

    Understanding the RelationshipType Enumeration [AX 2012] 3 out of 3 rated this helpful - Rate this t ...

  7. mysql表导入到oracle

    一.创建jack表,并导入一下数据 mysql),flwo )) engine=myisam; Query OK, rows affected (0.08 sec) mysql> load da ...

  8. 深入理解GCD(一)

    虽然 GCD 已经出现过一段时间了,但不是每个人都明了其主要内容.这是可以理解的:并发一直很棘手,而 GCD 是基于 C 的 API ,它们就像一组尖锐的棱角戳进 Objective-C 的平滑世界. ...

  9. [算法]判断一个数是不是2的N次方

    如果一个数是2^n,说明这个二进制里面只有一个1.除了1. a  = (10000)b a-1 = (01111)b a&(a-1) = 0. 如果一个数不是2^n, 说明它的二进制里含有多一 ...

  10. ACM题目————Aggressive cows

    Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stal ...