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. 高亮T4模板

    http://t4-editor.tangible-engineering.com/Download_T4Editor_Plus_ModelingTools.html

  2. 我给女朋友讲编程CSS系列(3) CSS如何设置字体的类型、大小、颜色,如何使用火狐浏览器的Firebug插件查看网页的字体

    一.CSS如何设置字体的类型.大小.颜色 设计网页时,一般设置body的字体,让其他标签继承body的字体,这样设置特别方便,但是标题标签h1到h6和表单标签(input类型)是没有继承body的字体 ...

  3. win7装python3.6提示api-ms-win-runtime-1-1-0.dll丢失

    win7为MSDN下的旗舰版,没有servicepack1那个,刚开始安装python3.6提示必须得安装servicepack1,于是乎到微软官网下了个900mb大小的安装包. https://ww ...

  4. Robotium之Android控件定位实践和建议

    本人之前曾经撰文描述Appium和UIAutomator框架是如何定位Android界面上的控件的. UIAutomator定位Android控件的方法实践和建议Appium基于安卓的各种FindEl ...

  5. 最好用的远程连接工具TeamviWer13安装教程(Win10环境)

    1.Teamviwer官网:https://www.teamviewer.com/zhCN/ 2.下载链接:https://dl.tvcdn.de/download/TeamViewer_Setup. ...

  6. Unable to execute dex: Multiple dex files define 问题

    今天在run公司的android project时候,报这个错误. 1. Clean Project, 重启Eclipse 没有解决. 2. 看到别人遇到的相同错误,解决方法如下: http://bl ...

  7. 目标检测算法SSD在window环境下GPU配置训练自己的数据集

    由于最近想试一下牛掰的目标检测算法SSD.于是乎,自己做了几千张数据(实际只有几百张,利用数据扩充算法比如镜像,噪声,切割,旋转等扩充到了几千张,其实还是很不够).于是在网上找了相关的介绍,自己处理数 ...

  8. 多IP指定出口IP地址 如何指定云服务器源IP?

    如果一个主机绑定有多个IP地址,那么在被动响应和主动发起连接两种方式中,源IP地址的选择机制肯定是有所差异的.主机在接收外部数据包,并发送响应数据包时,响应源地址显然就是客户端请求的地址,这是非常容易 ...

  9. 省选算法学习-数据结构-splay

    于是乎,在丧心病狂的noip2017结束之后,我们很快就要迎来更加丧心病狂的省选了-_-|| 所以从写完上一篇博客开始到现在我一直深陷数据结构和网络流的漩涡不能自拔 今天终于想起来写博客(只是懒吧.. ...

  10. [六省联考2017]组合数问题 (矩阵优化$dp$)

    题目链接 Solution 矩阵优化 \(dp\). 题中给出的式子的意思就是: 求 nk 个物品中选出 mod k 为 r 的个数的物品的方案数. 考虑朴素 \(dp\) ,定义状态 \(f[i][ ...