rem 
Rem  Copyright (c) 1993 by Oracle Corporation 
Rem    NAME
Rem      frm45up1.sql - <one-line expansion of the name>
Rem    DESCRIPTION
Rem      <short description of component this file declares/defines>
Rem    RETURNS
Rem 
Rem    NOTES
Rem      <other useful comments, qualifications, etc.>
Rem    MODIFIED   (MM/DD/YY)
Rem     smuench  11/28/94 -  Update for Oracle7 Roles new View Def
Rem     kyue     10/26/94 -  Creation 
Rem
Rem This script will upgrade the table from  4.5.4 to 4.5.5
Rem

Rem
Rem add one column for program unit.
Rem 
alter table FRM45__OBJECT add
(
     PROGRAMUNITID     number
);

create or replace view FRM45_ENABLED_ROLES as
select urp.granted_role role,
sum(distinct decode(rrp.granted_role,
   'ORAFORMS$OSC',2,
   'ORAFORMS$BGM',4,
   'ORAFORMS$DBG',1,0)) flag
from  sys.user_role_privs urp, role_role_privs rrp
where urp.granted_role = rrp.role (+)
  and urp.granted_role not like 'ORAFORMS$%'
group by urp.granted_role;


