/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2015 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
  EXECUTE IMMEDIATE 'DROP TYPE xxas_irc_document_table';
  EXECUTE IMMEDIATE 'DROP TYPE xxas_irc_document_type';
EXCEPTION
  WHEN e_obj_not_exists THEN
    NULL;
END;
/

CREATE TYPE xxas_irc_document_type AS OBJECT
  (document_id          number
  ,file_name            varchar2(4000)
  ,type                 varchar2(400)
  ,description          varchar2(4000)
  ,mime_type            varchar2(400)
  ,binary_doc           BLOB)
/

CREATE OR REPLACE TYPE xxas_irc_document_table IS
TABLE OF xxas_irc_document_type
/

COMMIT;
EXIT;
