/* $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_SORT_FIELDS_TBL FORCE';
  EXCEPTION WHEN e_obj_not_exists THEN
    NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE XXAS_FILTER_FIELDS_TBL FORCE';
  EXCEPTION WHEN e_obj_not_exists THEN
    NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE XXAS_SORT_FIELDS FORCE';
  EXCEPTION WHEN e_obj_not_exists THEN
    NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE XXAS_FILTER_FIELDS FORCE';
  EXCEPTION WHEN e_obj_not_exists THEN
    NULL;
  END;
END;
/

create or replace TYPE XXAS_SORT_FIELDS AS OBJECT
  (SORT_FIELD                     varchar2(240)
  ,SORT_TITLE                     varchar2(240)
  ,SORT_DIRECTION                 varchar2(10)
  ,SORT_TYPE                      varchar2(10)
  )
/

create or replace TYPE XXAS_SORT_FIELDS_TBL AS TABLE OF XXAS_SORT_FIELDS
/

create or replace TYPE XXAS_FILTER_FIELDS AS OBJECT
  (FILTER_FIELD                     varchar2(240)
  ,FILTER_TYPE                      varchar2(100)
  ,FILTER_TITLE                     varchar2(240)
  )
/
  
create or replace TYPE XXAS_FILTER_FIELDS_TBL AS TABLE OF XXAS_FILTER_FIELDS
/

COMMIT;
EXIT;
