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. 2、HTML基础总结 part-2

    1.表单一 <html> <body> <form> 姓名: <input type="text" name="name&quo ...

  2. [oldboy-django][2深入django]django 官方中文文档 --扩展User

    https://docs.djangoproject.com/en/2.0/topics/auth/customizing/#extending-the-existing-user-model # 另 ...

  3. java中的读/写锁

    读写锁接口:ReadWriteLock,它的具体实现类为:ReentrantReadWriteLock 使用场景: 对于一个资源,读读能共存,读写不能共存,写写不能共存. 锁降级:从写锁变成读锁: 锁 ...

  4. AtCoder Regular Contest 092 B Two Sequences

    题目大意 给定两个长为 $n$ 个整数序列 $a_1, \dots, a_n$ 和 $b_1, \dots, b_n$ .求所有 $a_i + b_j$($1\le i, j\le n$)的 XOR ...

  5. hihoCoder 1467 2-SAT·hihoCoder音乐节(2-SAT模版)

    #1467 : 2-SAT·hihoCoder音乐节 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 hihoCoder音乐节由hihoCoder赞助商大力主办,邀请了众 ...

  6. input[type="radio"]自定义样式

    input为radio时,虽然会有默认选中的样式,但是并不符合大多数项目的需求,我们的目标是可以随心所欲自定义它的样式.怎么做呢?其实很简单,只要抓住3点.分别是1.label 2.隐藏自带样式 3. ...

  7. 刷题总结——纸带(NOIP赛前模拟)

    题目: 有一个无限长的纸带··上面被划分为若干个格子··现在进行N次操作,第i次操作在L到R上擦出曾经写上的数字(如果有),并写上数字i,询问最终可以看到多少个数字 N小于10^6 题解: 首先毫无疑 ...

  8. vue的roter使用

    1在src下建立router文件夹,再建立router.js import Vue from 'vue' import Router from 'vue-router' import home fro ...

  9. windows系统部署springboot项目及绑定域名

    http://note.youdao.com/noteshare?id=c3ccea255affd2c5d79231d67fa29103&sub=187AEEEA5CF34531A2C2315 ...

  10. python(6)-- 模块

    python模块: 定义:Python 模块(Module),是一个 Python 文件,以 .py 结尾,包含了 Python 对象定义和Python语句. 作用:(a) 模块让你能够有逻辑地组织你 ...