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. zw版【转发·台湾nvp系列Delphi例程】HALCON Component Histogram

    zw版[转发·台湾nvp系列Delphi例程]HALCON Component Histogram unit Unit1;interfaceuses Windows, Messages, SysUti ...

  2. Sqlserver常用的时间函数---GETDATE、GETUTCDATE、DATENAME

    GETDATE 按 datetime 值的 Microsoft® SQL Server™ 标准内部格式返回当前系统日期和时间.语法GETDATE ( )返回类型datetime注释日期函数可用在 SE ...

  3. hibernate笔记01

  4. umask setuid setgid

    cat /etc/bashrc if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ];#用户UI ...

  5. django view使用学习记录

    判断用户是否登录 request.user.is_authenticated()auth.authenticate(username=username, password=password)

  6. svn权限控制

    http://blog.csdn.net/clever101/article/details/8159105 [groups] #核心层开发组成员 core_dev = lg,zjc #扩展层开发组成 ...

  7. Temporary InMemory Tables [AX 2012]

    Temporary InMemory Tables [AX 2012] This topic has not yet been rated - Rate this topic Updated: Oct ...

  8. 如何用javascript 的eval动态执行一个需要传对象参数的函数

    代码如下: var method = 'setRiskItemAmount_'+id[1]+'(id[0],id[2],this.value);'; console.log(method); eval ...

  9. org.apache.cxf.transport.servlet.CXFServlet cannot be cast to javax.servlet.Servlet

    java.lang.ClassCastException: org.apache.cxf.transport.servlet.CXFServlet cannot be cast to javax.se ...

  10. HDU 5961:传递(暴搜)

    http://acm.hdu.edu.cn/showproblem.php?pid=5961 题意:中文题意.给出两个图,判断这个两个图是否都是传递的.注意一下传递的定义要看清,一开始没看清连样例都看 ...