Examples For When-Validate-Item trigger In Oracle Forms
The following example finds the commission plan in the COMMPLAN table, based on the current value of the commcode item in the EMPLOYEE block in the form, to verify that the code is valid.
If the code in the COMMPLAN table is located, the description of the COMMPLAN is obtained and deposited in the non-database Description item. Otherwise, an error is raised.
/*
** Method 1: Using a SELECT...INTO statement, the trigger
** looks more readable but can be less efficient
** than Method 2 because for ANSI Standard
** compliance, the SELECT...INTO statement must
** return an error if more than one row is
** retrieved that matches the criteria. This
** implies PL/SQL may attempt to fetch data twice
** from the table in question to insure that there
** aren’t two matching rows.
*/
BEGIN
SELECT description
INTO :Employee.Commplan_Desc
FROM commplan
WHERE commcode = :Employee.Commcode;
EXCEPTION
WHEN No.Data_Found THEN
Message(’Invalid Commission Plan, Use <List> for help’);
RAISE Form_trigger_Failure;
WHEN Too_Many_Rows THEN
Message(’Error. Duplicate entries in COMMPLAN table!’);
RAISE Form_trigger_Failure;
END;
/*
** Method 2: Using an Explicit Cursor looks a bit more
** daunting but is actually quite simple. The
** SELECT statement is declared as a named cursor
** in the DECLARE section and then is OPENed,
** FETCHed, and CLOSEd in the code explicitly
** (hence the name). Here we guarantee that only a
** single FETCH will be performed against the
** database.
*/
DECLARE
noneFound BOOLEAN;
CURSOR cp IS SELECT description
FROM commplan
WHERE commcode = :Employee.Commcode;
BEGIN
OPEN cp;
FETCH cp INTO :Employee.Commplan_Desc;
noneFound := cp%NOTFOUND;
CLOSE cp;
IF noneFound THEN
Message(’Invalid Commission Plan, Use <List> for help’);
RAISE Form_trigger_Failure;
END IF;
END;
Examples For When-Validate-Item trigger In Oracle Forms的更多相关文章
- An Example of On-Error Trigger in Oracle Forms
I wrote this trigger around 4 years ago to handle errors in an application based on Oracle Forms 6i. ...
- Using Post-Form Trigger In Oracle Forms
Post-Form trigger in Oracle Forms fires during the Leave the Form process, when a form is exited. ...
- Using Pre-Form Trigger In Oracle Forms
Pre-Form trigger in Oracle Forms fires during the form start-up, before forms navigates to the first ...
- 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 ...
- Define Custom Data Filter Using Pre-Query Trigger In Oracle Forms
Oracle Forms is having its default records filter, which we can use through Enter Query mode to spec ...
- Writing On-Error Trigger In Oracle Forms
Suppose you want to handle an error in oracle forms and want to display custom error message for tha ...
- Using Post_Query Trigger in Oracle Forms
When a query is open in the block, the Post-Query trigger fires each time Form Builder fetches a rec ...
- An Example Of Validating Text Item In Oracle Forms Using When-Validate-Item Trigger
Example is given below to validate a Text Item in Oracle Forms with specific rules condition which c ...
- How to Log Users Login and Logout Details Through Oracle Forms
Log user's login and logout details in to table through Oracle Forms using POST-LOGON and PRE-LOGOUT ...
随机推荐
- 解决ultravnc在win2008 R2下CTRL+ALT+DELETEA组合键发送失败的问题
首先,请google “ultravnc ctrl+alt+delete”,得到的解决方法是,更改UAC.进入组策略-计算机配置-管理模板-windows登陆选项,“禁用或启用软件注意序列”,更改成“ ...
- iBatis叙述
1.添加Mybatis的配置文件conf.xml 在src目录下创建一个conf.xml文件,如下图所示: 2.定义表所对应的实体类 3.定义操作users表的sql映射文件userMapper.xm ...
- 根据linux内核源码查找recv返回EBADF(errno 9)的原因
linux的内核版本是2.6.18,x86_64. man里的解释是: EBADF The argument s is an invalid descriptor 我的模拟测试环境是: 前端loadr ...
- selenium webdriver三种等待方法
webdriver三种等待方法 1.使用WebDriverWait from selenium import webdriverfrom selenium.webdriver.common.by im ...
- ueditor .NET版本提示uploader、Config类同时存在于两个dll中
在网上查看了下,主要有两种解决办法 1.直接删除,以下引用. <%@ Assembly Src="Uploader.cs" %><%@ Assembly Src= ...
- Unexpected error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xd2 in position 69: ordinal not in range(128)-解决办法
- NXP QN9020
NXP的这个BLE蓝牙方案也很有趣, 一起研究. 这个函数在app_gpa_task.c里面 ***************************************************** ...
- 【jQuery UI 1.8 The User Interface Library for jQuery】.学习笔记.3.创建控件
像jQuery提供 fn.extend() 方法从而可以简单地创建插件一样,jQuery UI也提供了机制使得创造插件变得简单,也确保了公共API功能在新的插件中被保留. 1.首先,创建一个名为 j ...
- Ubuntu 14.04 安装 JDK 7.0
1.新建jvm文件夹-解压 # mkdir /usr/lib/jvm # tar zxvf jdk-7u79-linux-x64.gz -C /usr/lib/jvm 2.设置环境变量,在/etc/p ...
- mysql表导入到oracle
一.创建jack表,并导入一下数据 mysql),flwo )) engine=myisam; Query OK, rows affected (0.08 sec) mysql> load da ...