__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
 WHERE SCRIPT_FILE_NAME = 'FW45001_BPSCHEMA_OUAF-34660.SQL'
   AND END_DTTM IS NOT NULL
/
__THEN__

__EXIT__

__ENDIF__

__IF_EXISTS__
SELECT 1
  FROM USER_TABLES
WHERE TABLE_NAME = 'F1_INSTALLATION'
/
__ELSE__

__EXIT__

__ENDIF__


__IF_EXISTS__
SELECT 1
  FROM USER_TABLES
 WHERE TABLE_NAME = 'F1_PROC_PANEL'
/
__ELSE__

__EXIT__

__ENDIF__


__IF_EXISTS__
SELECT 1
  FROM USER_TAB_COLUMNS A, USER_POLICIES B
 WHERE A.TABLE_NAME = 'F1_PROC_PANEL'
   AND A.COLUMN_NAME = 'UI_MAP_CD'
   AND A.DATA_TYPE='VARCHAR2'
   AND A.TABLE_NAME = B.OBJECT_NAME
/
__THEN__

begin
DBMS_RLS.ENABLE_POLICY (object_name =>'F1_PROC_PANEL',policy_name => 'F1_PROC_PANEL_POLICY', enable => FALSE);
end;
/

ALTER TABLE F1_PROC_PANEL modify UI_MAP_CD char (30)
/

begin
DBMS_RLS.ENABLE_POLICY (object_name =>'F1_PROC_PANEL',policy_name => 'F1_PROC_PANEL_POLICY', enable => TRUE);
end;
/

__ELSE__

__EXIT__

__ENDIF__

