-- {{ $Header: L:\\\\model\\jin\\RCS\\jrpol.jpb 1.2 1998/10/08 11:15:44 cwilliam Exp $ -- {{ ------------------------------------------------------------------------ -- File: $Workfile: headers.e $ -- Author: $Author: cwilliam $ -- Date: $Date: 1998/10/08 11:15:44 $ -- Version: $Revision: 1.2 $ -- Status: $State: Exp $ -- Locked_by: $Locker: $ -- Project: The Oracle Common Repository -- Description: -- Notes: -- RealAuth: plorrime -- IncepDate: 7/16/1998 -- Copyright: (c) Oracle Corporation 1997. All Rights Reserved. -- Tagline: -- Oracle Repository: Managing *all* your data -- -- --------------------------------------------------------------------------- -- Log of Changes from Source Control System -- --------------------------------------------------------------------------- -- $Log: jrpol.jpb $ -- Revision 1.2 1998/10/08 11:15:44 cwilliam -- Fixed bug 739981 to rename modify audit columns and bug 738509 to make -- them optional -- rem Revision 1.1 1998/07/23 10:56:35 plorrime rem Initial revision rem -- }} ------------------------------------------------------------------------ -- -- This package controls a table of NVP (name value pairs). It operates much like -- environment variable do (or any other NVP for that matter). -- -- The purpose of the table is to set repos "global" policies. For example -- strict lock on check out. Such polices are not specific to any particular -- user but must be applied to all users. -- -- The table is just NVP so that any config data can be put in there. -- There is no delete from the table. It's not necessary. -- -- To use the table you should write PLSQL to ensure that names are -- used consistently. -- prompt Package Body: jr_policy create or replace package body jr_policy is -- -- Set a NVP. -- If name exists then overrite value. -- If name new then insert new row. -- procedure set_policy(i_name in varchar,i_value in varchar) is begin --User must have SET_POLICY system privilege to set policies if not jr_sys_privs.has_privilege(USER,'SET_POLICY') then --Insufficient privileges to set Repository Policies. rmmes.post('CDR',2607); raise jr_sys_privs.SYSTEM_PRIV_ERROR; end if; insert into i$sdd_repos_policies (name, value) values (i_name, i_value); exception when DUP_VAL_ON_INDEX then update i$sdd_repos_policies set value = i_value , date_changed = SYSDATE , changed_by = USER where name = i_name; end; -- -- Get a value given a name. -- If no such name return null. -- function get_policy(i_name in varchar2) return varchar2 is o_value varchar2(128); begin select value into o_value from i$sdd_repos_policies where name=i_name; return o_value; exception when NO_DATA_FOUND then return null; end; end; / -- ---------------------------------------------------------------------------- -- }} End of file $Workfile: headers.e $ $$Header_is_done -- ----------------------------------------------------------------------------