/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2008 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_COM_MSG_VARRAY FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE XXAS_COM_MSG_TYPE FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE XXAS_COM_MSG_TOKEN_VARRAY FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE XXAS_COM_MSG_TOKEN_TYPE FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;

END;  
/

CREATE OR REPLACE TYPE XXAS_COM_MSG_TOKEN_TYPE AS OBJECT
  (token_name  varchar2(30)
  ,token_value varchar2(2000))
/

CREATE OR REPLACE TYPE XXAS_COM_MSG_TOKEN_VARRAY AS
VARRAY(50) OF XXAS_COM_MSG_TOKEN_TYPE
/

CREATE OR REPLACE TYPE XXAS_COM_MSG_TYPE AS OBJECT
  (message_app    varchar2(30)
  ,message_name   varchar2(80)
  ,message_tokens xxas_com_msg_token_varray)
/

CREATE OR REPLACE TYPE XXAS_COM_MSG_VARRAY AS
VARRAY(100000) OF XXAS_COM_MSG_TYPE
/

COMMIT;
EXIT;
