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. Java高效编程之一【创建和销毁对象】

    一.考虑用静态工厂方法替代构造函数 代表实现:java.util.Collection Framework Boolean类的简单例子: public static Boolean valueOf ( ...

  2. DataGridView 些许事件测试

    原始设计需求:当单元格内容是空白时,鼠标进入之后,显示一些数据 直观的第一感觉必然是用CellClick,细想,如果用户不用鼠标,直接按Tab键切换单元格呢?又或者,用户直接双击涅~ 主要测试的是:  ...

  3. equals和==

    在初学Java时,可能会经常碰到下面的代码: 1 String str1 = new String("hello"); 2 String str2 = new String(&qu ...

  4. [转]bit与byte

    本文为转载,感谢博主的分享.原文地址:http://www.cnblogs.com/flyme/archive/2011/08/25/2153596.html bit意为“位”或“比特”,是计算机运算 ...

  5. tomcat缓存静态资源深入

    之前看过apach及nginx对于静态资源(含js,图片,css等)部分的缓存,用于加速并减轻后台实际web服务器的压力. 静态资源缓存是WEB服务器优化的一种手段,基本原理如下: 1.客户端浏览器请 ...

  6. 和菜鸟一起学linux总线驱动之初识spi驱动数据传输流程【转】

    转自:http://blog.csdn.net/eastmoon502136/article/details/7921846 对于SPI的一些结构体都有所了解之后呢,那么再去瞧瞧SPI的那些长见的操作 ...

  7. JS和CSS的多浏览器兼容(1)

    1.指定文件在IE浏览器中的兼容性模式 要为你的网页指定文件模式,需要在你的网页中使用meta元素放入X-UA-Compatible http-equiv 标头.以下是指定为Emulate IE7 m ...

  8. HDU 4453:Looploop(Splay各种操作)

    http://acm.hdu.edu.cn/showproblem.php?pid=4453 题意:很多种操作:1.add x,将从光标起的 k2 个数全部加上 x:2.reverse,将从光标起的 ...

  9. Window驱动开发

    驱动开发 参考文章: Windbg+Vmware驱动调试 http://blog.csdn.net/xuepiaosong/article/details/8236702 驱动调试攻略(WinDbg) ...

  10. linux命令:du 命令

    Linux du命令也是查看使用空间的,但是与df命令不同的是Linux du命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的. 1.命令格式: du [选项][文件] 2.命令功能 ...