/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2016 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

DECLARE
  e_obj_not_exists EXCEPTION;
  PRAGMA EXCEPTION_INIT(e_obj_not_exists, -04043);
BEGIN
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE xxas_grant_table';
  EXCEPTION WHEN e_obj_not_exists THEN
    NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE xxas_grant_type';
  EXCEPTION WHEN e_obj_not_exists THEN
    NULL;
  END;
END;
/

/*============================================================================*
 | Name    : xxas_grant_type                                                 |
 *===========================================================================*/
CREATE OR REPLACE TYPE xxas_grant_type AS OBJECT
  (function_id            number
  ,function_name          varchar2(80)
  ,inheritance            varchar2(4000)
  ,function_obj_name      varchar2(80)
  ,grant_guid             varchar2(400)
  ,grant_name             varchar2(400)
  ,grantee_type           varchar2(80)
  ,grantee_key            varchar2(400)
  ,role_display_name      varchar2(400)
  ,granted_menu_name      varchar2(400)
  ,grant_obj_name         varchar2(400)
  ,grant_instance_type    varchar2(400)
  ,instance_set_code      varchar2(400)
  ,instance_set_name      varchar2(400)
  ,instance_set_predicate varchar2(4000)
  ,start_date             date
  ,end_date               date
  )
/

/*============================================================================*
 | Name    : xxas_grant_table                                                |
 *===========================================================================*/
CREATE OR REPLACE TYPE xxas_grant_table IS TABLE OF xxas_grant_type
/

COMMIT;
EXIT;
