Suppose you want to check the user permissions on inserting or updating the records in Oracle Forms, then you can use Pre-Insert and Pre-Update triggers for that particular data block to check whether user is having proper permission or not.
 
The example is given for HR schema and the following demo table is created for this:
 
Create Table User_Permissions (User_Name varchar2(50) Primary Key,
Can_Insert Varchar2(1) default 'N',
Can_Update Varchar2(1) default 'N')
 
Insert into User_Permissions values ('FORMUSER1', 'Y', 'N');
 
Commit;
 
Below is the screen shot for the examle:
 
 
You can download this form from the following link: Pre-Update-Insert.fmb
 
The following is the code written in Pre-Update trigger to check the permissions from the database:
 
Declare
n_allow number;
begin
Select 1 into n_allow
   from hr.user_permissions
   where user_name = 'FORMUSER1'
   and can_update = 'Y';
   --- all is well if no exception raised else stop in exception area
   exception
     when others then
        message('You have no permission to update the record.');
        message('You have no permission to update the record.');
        raise form_trigger_failure;
end;
 
The following is the code written in Pre-Insert trigger to check the permissions from the database on Insert:
 
Declare
n_allow number;
begin
Select 1 into n_allow
   from hr.user_permissions
   where user_name = 'FORMUSER1'
   and can_insert = 'Y';
   --- all is well if no exception raised else stop in exception area

   exception
     when others then
        message('You have no permission to insert the record.');
        message('You have no permission to insert the record.');
        raise form_trigger_failure;
       
end;

The code is written for Save button:

Commit_form;

Checking For User Permissions Before Updating or Inserting The Records in Oracle Forms的更多相关文章

  1. 查找EBS中各种文件版本(Finding File Versions in the Oracle Applications EBusiness Suite - Checking the $HEADER)

    Finding File Versions in the Oracle Applications EBusiness Suite - Checking the $HEADER (文档 ID 85895 ...

  2. Programming Entity Framework 翻译(1)-目录

    1. Introducing the ADO.NET Entity Framework ado.net entity framework 介绍 1 The Entity Relationship Mo ...

  3. RAC的QA

    RAC: Frequently Asked Questions [ID 220970.1]   修改时间 13-JAN-2011     类型 FAQ     状态 PUBLISHED   Appli ...

  4. Understanding Item Import and Debugging Problems with Item Import (Doc ID 268968.1)

    In this Document Purpose Details   Scenario 1: Testing the basic item import with minimum columns po ...

  5. 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境

    1.资源准备 最近,在VmwareStation 10虚拟机上,基于CentOS5.4安装Oracle 11g RAC,并把过程记录下来.刚开始时,是基于CentOS 6.4安装Oracle 11g ...

  6. 一步一步搭建 oracle 11gR2 rac+dg之grid安装(四)【转】

    一步一步在RHEL6.5+VMware Workstation 10上搭建 oracle 11gR2 rac + dg 之grid安装 (四) 转自 一步一步搭建 oracle 11gR2 rac+d ...

  7. 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:3.安装Oracle RAC-3.4.安装Grid Infrastructure

    3.4.安装Grid Infrastructure 3.4.1.安装Grid 1.运行 grid的安装文件runInstaller [grid@linuxrac1 grid]$ ./runInstal ...

  8. VMware搭建Oracle 11g RAC测试环境 For Linux

    环境如下: Linux操作系统:Centos 6.5 64bit (这个版本的redhat 6内核等OS在安装grid最后执行root.sh时会出现crs-4124,是oracle11.2.0.1的b ...

  9. ProxySQL Tutorial : setup in a MySQL replication topology

    ProxySQL Tutorial : setup in a MySQL replication topology 时间 2015-09-15 05:23:20 ORACLE数据库技术文刊 原文  h ...

随机推荐

  1. access调用联系

    using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; us ...

  2. 【Ah20160703】咏叹 By C_SUNSHINE

    咏叹 By C_SUNSHINE [试题描述] Salroey拿到了一个1~n的排列A,她想对这个排列进行冒泡排序: counter=0 While A不是升序的 counter=counter+1 ...

  3. 编写更少bug的程序的六条准则

          如何编写更少bug的程序?  尽可能避免常见的程序错误.              沟通设计先行 + 编写可复用代码 + 做得更多 + 做的更少 + 创造“编程心流”+ 严格的程序测试   ...

  4. java map 遍历

    转自http://rain-2372.iteye.com/blog/1615615 package com.spring.test_B11_aop1; import java.util.HashMap ...

  5. 霸气的jQ插件

    http://codepen.io/ canvas的各种实例 1.The Responsive jQuery Content Slider http://bxslider.com/ 2.ThemePu ...

  6. 【转】MYSQL入门学习之四:MYSQL的数据类型

    转载地址:http://www.2cto.com/database/201212/175536.html 一.整型  www.2cto.com            整数类型是数据库中最基本的数据类型 ...

  7. 【转】SVN服务器搭建--Subversio与TortoiseSVN的配置安装

    转载地址:http://blog.csdn.net/xinxin19881112/article/details/6410263 1.  Subversio和TortoiseSVN 简介 Subver ...

  8. 【转】解决svn Authorization failed错误

    转载地址:http://blog.sina.com.cn/s/blog_4b93170a0100leb2.html 出现该问题基本都是三个配置文件的问题,下面把这个文件列出来 svnserve.con ...

  9. C# 加密解密

    using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Secur ...

  10. drawer principle in Combinatorics

    Problem 1: Given an array of real number with length (n2 + 1) A: a1,  a2, ... , an2+1. Prove that th ...