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. LR Socket 测试demo

    建议像我这样最开始未接触过的,还是先从简单录制开始.录制完之后,分析测试脚本,再学习,再自己根据需要编写测试脚本. 第一:录制. A.    B. 选择需要录制的exe的目录 ,填写完后点击ok. C ...

  2. 一个fork()系统调用的问题

    转载:http://coolshell.cn/articles/7965.html 题目:请问下面的程序一共输出多少个“-”? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...

  3. 分享总结:更好地CodeReview

            代码质量分享    2016_06_24_舒琴_代码质量.key    For 代码提交人     基本原则 Review时机: 对于普通bugfix或优化,CodeReview最迟要 ...

  4. bash

    unix - Unlimited Bash History - Stack Overflowhttp://stackoverflow.com/questions/9457233/unlimited-b ...

  5. 161206、 Ionic、Angularjs、Cordova搭建Android开发环境

    1.jdk 环境变量配置 path:C:\Program Files\Java\jdk1.7.0_79\bin 2.Node.js 因为安装cordova时要用到node.js的npm 下载地址: h ...

  6. 14 个 grep 命令的例子 【转】

    转自:https://linux.cn/article-5453-1.html 编译自:http://www.linuxtechi.com/linux-grep-command-with-14-dif ...

  7. Hive与数据库的异同

    一.Hive简介 Hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供完整的sql查询功能,可以将sql语句转换为MapReduce任务进行运行.其优点是学习 ...

  8. 以雅酷网为实例从技术上说说dedecms的seo优化要注意哪些?

    目前在做雅酷网 ,雅酷卡是雅酷时空公司的产品,我个人感觉用雅酷卡消费还是比较实惠的,而雅酷卡的特色便是雅酷健身卡,很多站长成天的趴电脑上,可以考虑办一张这样的卡,在周末的时候去健身中心活动活动,还是比 ...

  9. Oracle性能优化--DBMS_PROFILER

      想看到过程或者函数执行每一步的过程:想看到每一步所占的时间吗?借助profiler吧:它可以满足你来分析过程/函数执行比较久:可以直接快速找到病因:从而可以优化那一步需要优化下.        一 ...

  10. js 对象toString()方法

    ({}+{}).length == 30; ({}).toString() '[object Object]' 当对象需要调用toString()方法时会被自动调用.