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 ...
随机推荐
- 基于时间点恢复数据库stopat
create database newtestdb use newtestdbgo drop table t1go create table t1 (id int not null identity( ...
- TI CC2541的GPIO引脚设置.
P1SEL寄存器, 0xF4, 功能选择用的, 0表示GPIO口, 1表示外设.
- php ssh2 scp问题解决
<?php$connection = ssh2_connect('192.168.1.XX', 22);$res=ssh2_auth_password($connection, 'root', ...
- Linux中重定向命令行
http://www.ahlinux.com/start/base/3170.html
- Codeforces 745C:Hongcow Builds A Nation(并查集)
http://codeforces.com/problemset/problem/744/A 题意:在一个图里面有n个点m条边,还有k个点是受限制的,即不能从一个受限制的点走到另外一个受限制的点(有路 ...
- hdwiki model目录下的函数类
model目录下的函数类 actions.class.php(站内地图相关) getHTML:获得页面菜单和相关信息 getMap:生成站内地图 adv.class.php 对wiki_adve ...
- android FragmentPagerAdapter getItem方法没有执行
转自 http://blog.csdn.net/getchance/article/details/40263505 在一个 Android 应用中,我使用 FragmentPagerAdapter ...
- c# TCPclient
服务端 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; ...
- Paths on a Grid(简单组合数学)
Paths on a Grid Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 23008 Accepted: 5683 Desc ...
- vsftp 用无法登陆的用户名登陆(也叫虚拟用户)并进入到自己的文件夹test
1.不需要使用到PAM认证也可以,useradd redhat; usermod -s /sbin/nologin redhat; passwd redhat. 2.userlist_deny=NO; ...