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. yii2购物车实现

    1.商品列表中点击加入购物车,则跳转到购物车列表,效果如图所示: 视图代码goods/list.php中.代码如下: <?php echo Html::a('加入购物车',['cart','id ...

  2. sql语句中where和having的区别

    WHERE语句在GROUPBY语句之前:SQL会在分组之前计算WHERE语句. HAVING语句在GROUPBY语句之后:SQL会在分组之后计算HAVING语句.

  3. imread函数、namedWindow函数、imshow函数、imwrite函数

    1.imread函数 首先,我们看imread函数,可以在OpenCV官方文档中查到其原型如下: Mat imread(const string& filename, int flags=1 ...

  4. sql2005镜像实现

    -- ===========================================    -- 无论是主体服务器.镜像服务器, 还是见证服务器    -- 除特别说明外,均需要保证下面的操作 ...

  5. WCF入门教程:WCF基础知识问与答(转)

    学习WCF已有近两年的时间,其间又翻译了Juval的大作<Programming WCF Services>,我仍然觉得WCF还有更多的内容值得探索与挖掘.学得越多,反而越发觉得自己所知太 ...

  6. 视频处理控件TVideoGrabber中如何混合多个视频源(1)

    其实一个或是几个作为普通的视频源使用的TVideoGrabber组件,可以进行混合来作为一个TVideoGrabber组件使用,这些普通的组件可以是视频捕捉设备或是视频剪辑等.同时这个混合的组件独立于 ...

  7. PHPCMS V9 环境搭建

    PHPCMS V9的学习总结分为以下几点: [1]PHPCMS 简介 PHP原始为Personal Home Page的缩写,(外文名:PHP: Hypertext Preprocessor,中文名: ...

  8. Ubuntu1404: 将VIM打造为一个实用的PythonIDE

    参考:  http://www.tuicool.com/articles/ZRv6Rv 说明: 内容非原创, 主要是做了整合和梳理. 在 ubuntu14.04 & debian 8 下测试通 ...

  9. 如何从innodb的数据字典里恢复表结构

    需要学会使用percona-data-recovery-tool-for-innodb,用这个:sys_parser,参考这篇文章,

  10. DE1-SOC开发板上搭建NIOS II处理器运行UCOS II

    DE1-SOC开发板上搭建NIOS II处理器运行UCOS II   今天在DE1-SOC的开发板上搭建NIOS II软核运行了UCOS II,整个开发过程比较繁琐,稍微有一步做的不对,就会导致整个过 ...