/* $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_block_table';
  EXCEPTION WHEN e_obj_not_exists THEN
    NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE xxas_block_type';
  EXCEPTION WHEN e_obj_not_exists THEN
    NULL;
  END;
END;
/

CREATE OR REPLACE TYPE xxas_block_type AS OBJECT
  (sequence    NUMBER
  ,function_id NUMBER
  ,block_title VARCHAR2(4000)
  ,description VARCHAR2(4000)
  ,active_block_flag VARCHAR(10)
  ,keys        xxas_com_keys_type)
/

CREATE OR REPLACE TYPE xxas_block_table IS TABLE OF xxas_block_type
/

COMMIT;
EXIT;
