An example given below for Oracle Forms, when a value exists then execute query for that value to display the correspondent record else allow user to create a new record for that value.

The following is the example given for HR schema employee table, in this example user will enter an empoyee id and if the employee id exists it will query the record else allow user to create a new record, the trigger written on key-next-item trigger, you can download the employees.fmb form also from the following link employees.fmb

KEY-NEXT-ITEM trigger code

declare
v_empid employees.employee_id%type;
Begin
  Select employee_id into v_empid
     from hr.employees
     where employee_id = :employees.employee_id;
     -- value exists
     -- set block property and execute query
     clear_block(no_validate);
   
     set_block_property('employees', default_where, 'employee_id = '||v_empid);
     execute_query;
     set_block_property('employees', default_where, '');
     next_item;
exception
when no_data_found then
   -- when not then clear block and allow to add new
   v_empid := :employees.employee_id;
   clear_block(no_validate);
   :employees.employee_id := v_empid;
   next_item;
End;
 

If Value Exists Then Query Else Allow Create New in Oracle Forms An Example的更多相关文章

  1. Learn How To Create Trigger In Oracle Forms

    I have written many posts related to triggers in Oracle Forms, I have given examples for Form Level ...

  2. 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 ...

  3. 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 ...

  4. Map Columns From Different Tables and Create Insert and Update Statements in Oracle Forms

    This is one of my most needed tool to create Insert and Update statements using select or alias from ...

  5. Create Timer Example To Show Image Presentation in Oracle Forms

    Suppose you want to change multiple images after a specified time in home screen of your oracle form ...

  6. 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 ...

  7. Create Custom Modal Dialog Windows For User Input In Oracle Forms

    An example is given below to how to create a modal dialog window in Oracle Forms for asking user inp ...

  8. Create Stacked Canvas to Scroll Horizontal Tabular Data Blocks In Oracle Forms

    In this tutorial you will learn to create horizontal scrollable tabular or detail data block by usin ...

  9. [Oracle] - Create DB on Oracle 12c for an Application

    Let's say we are going to develop a application for a bank, or any other enterprise, this applicatio ...

随机推荐

  1. leetcode 【 Plus One 】python 实现

    题目: Given a non-negative number represented as an array of digits, plus one to the number. The digit ...

  2. IOS开发学习笔记008-预处理

    预处理 1.宏定义 2.条件编译 3.文件包含 注意: 1.所有预处理都是以#开头,并且结尾不用分号. 2.宏名一般用大写字母,以便与变量名区别开来,但用小写也没有语法错误 3.作用域也是从定义到代码 ...

  3. ogre3D学习基础18 -- 材质的使用与脚本的简单书写

    这一节以基础16为基础,练习材质的使用. 第一,看看框架 //material #include "ExampleApplication.h" class TutorialAppl ...

  4. java自动化测试开发环境搭建(更新至2018年10月8日 11:42:15)

    1.安装JDK的1.8版本 官网下载地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151 ...

  5. Leetcode 502.IPO

    IPO 假设 LeetCode 即将开始其 IPO.为了以更高的价格将股票卖给风险投资公司,LeetCode希望在 IPO 之前开展一些项目以增加其资本. 由于资源有限,它只能在 IPO 之前完成最多 ...

  6. Spring4.0实战 rest相关

    package com.paic.pay.merchant.web; import com.paic.pay.merchant.entity.MerchantUser; import com.paic ...

  7. mysql查看语句执行状态的常见函数

    row_count() 返回上一个insert.update.delete语句的影响行数 found_rows() 返回上一个select查到的记录条数 last_insert_id() 返回上一次插 ...

  8. This dependency was not found: * !!vue-style-loader!css-loader? 解决方案

    但是当你新建一个vue项目时,需要重新安装stylus,否则报错: This dependency was not found: * !!vue-style-loader!css-loader?{&q ...

  9. 勒索病毒 -- “永恒之蓝”NSA 武器免疫工具

    “永恒之蓝”NSA 武器免疫工具 针对 445 端口:445端口是一个毁誉参半的端口,他和139端口一起是IPC$入侵的主要通道.有了它我们可以在局域网中轻松访问各种共享文件夹或共享打印机,但也正是因 ...

  10. 关于在生命周期当中进行setState操作的问题

    当需要监听组件的属性改变的时候有两个生命周期componentWillReceiveProps和componentWillUpdate 当使用componentWillUpdate的时候可以获取到将要 ...