create table UR_ZTEMP_1  (
   ARPT_ID              VARCHAR2(36)                     not null,
   ADATA_ID             VARCHAR2(36)                     not null,
   IDX_CODE             VARCHAR2(36)                     not null,
   DISP_NAME            VARCHAR2(120),
   SEQ_NO               INTEGER                        default 1,
   DISP_TYPE            VARCHAR2(1)                    default 'M',
   EXT_HORI_TYPE        VARCHAR2(1)                    default 'N',
   IS_GRP               VARCHAR2(1)                    default '0',
   GRP_CODE_LVL         VARCHAR2(30),
   SUM_DISP_COL         VARCHAR2(36),
   SUM_BACK_COLOR       VARCHAR2(30),
   SUM_FRONT_COLOR      VARCHAR2(30),
   SUM_FONT             VARCHAR2(30),
   SUM_TYPE             VARCHAR2(1),
   IS_THROW_OFF_REPEAT  VARCHAR2(1)                    default '0',
   IS_ONLY_SHOW_DETAIL  VARCHAR2(1)                    default '0',
   IS_IND               VARCHAR2(1)                    default '0',
   SORT_NO              INTEGER                        default 0,
   SORT_TYPE            VARCHAR2(1)                    default '0',
   IS_ASC               VARCHAR2(1)                    default '1'
);

insert into UR_ZTEMP_1 (
   ARPT_ID             ,
   ADATA_ID            ,
   IDX_CODE            ,
   DISP_NAME        ,
   SEQ_NO           ,
   DISP_TYPE           ,
   EXT_HORI_TYPE       ,
   IS_GRP              ,
   GRP_CODE_LVL       ,
   SUM_DISP_COL       ,
   SUM_BACK_COLOR     ,
   SUM_FRONT_COLOR    ,
   SUM_FONT           ,
   SUM_TYPE           ,
   IS_THROW_OFF_REPEAT ,
   IS_ONLY_SHOW_DETAIL ,
   IS_IND              ,
   SORT_NO             ,
   SORT_TYPE           ,
   IS_ASC
) select ARPT_ID             ,
   ADATA_ID            ,
   IDX_CODE            ,
   DISP_NAME        ,
   SEQ_NO           ,
   DISP_TYPE           ,
   EXT_HORI_TYPE       ,
   IS_GRP              ,
   GRP_CODE_LVL       ,
   SUM_DISP_COL       ,
   SUM_BACK_COLOR     ,
   SUM_FRONT_COLOR    ,
   SUM_FONT           ,
   SUM_TYPE           ,
   IS_THROW_OFF_REPEAT ,
   IS_ONLY_SHOW_DETAIL ,
   IS_IND              ,
   SORT_NO             ,
   SORT_TYPE           ,
   IS_ASC    from UR_ARPT_DS_IDX;


drop table UR_ARPT_DS_IDX;

create table UR_ARPT_DS_IDX  (
   ARPT_ID              VARCHAR2(36)                     not null,
   ADATA_ID             VARCHAR2(36)                     not null,
   IDX_CODE             VARCHAR2(136)                     not null,
   DISP_NAME            VARCHAR2(120),
   SEQ_NO               INTEGER                        default 1,
   DISP_TYPE            VARCHAR2(1)                    default 'M',
   EXT_HORI_TYPE        VARCHAR2(1)                    default 'N',
   IS_GRP               VARCHAR2(1)                    default '0',
   GRP_CODE_LVL         VARCHAR2(30),
   SUM_DISP_COL         VARCHAR2(36),
   SUM_BACK_COLOR       VARCHAR2(30),
   SUM_FRONT_COLOR      VARCHAR2(30),
   SUM_FONT             VARCHAR2(30),
   SUM_TYPE             VARCHAR2(1),
   IS_THROW_OFF_REPEAT  VARCHAR2(1)                    default '0',
   IS_ONLY_SHOW_DETAIL  VARCHAR2(1)                    default '0',
   IS_IND               VARCHAR2(1)                    default '0',
   SORT_NO              INTEGER                        default 0,
   SORT_TYPE            VARCHAR2(1)                    default '0',
   IS_ASC               VARCHAR2(1)                    default '1',
   constraint PK_UR_ARPT_DS_IDX primary key (ARPT_ID, ADATA_ID, IDX_CODE)
);

insert into UR_ARPT_DS_IDX (
   ARPT_ID             ,
   ADATA_ID            ,
   IDX_CODE            ,
   DISP_NAME        ,
   SEQ_NO           ,
   DISP_TYPE           ,
   EXT_HORI_TYPE       ,
   IS_GRP              ,
   GRP_CODE_LVL       ,
   SUM_DISP_COL       ,
   SUM_BACK_COLOR     ,
   SUM_FRONT_COLOR    ,
   SUM_FONT           ,
   SUM_TYPE           ,
   IS_THROW_OFF_REPEAT ,
   IS_ONLY_SHOW_DETAIL ,
   IS_IND              ,
   SORT_NO             ,
   SORT_TYPE           ,
   IS_ASC
) select ARPT_ID             ,
   ADATA_ID            ,
   IDX_CODE            ,
   DISP_NAME        ,
   SEQ_NO           ,
   DISP_TYPE           ,
   EXT_HORI_TYPE       ,
   IS_GRP              ,
   GRP_CODE_LVL       ,
   SUM_DISP_COL       ,
   SUM_BACK_COLOR     ,
   SUM_FRONT_COLOR    ,
   SUM_FONT           ,
   SUM_TYPE           ,
   IS_THROW_OFF_REPEAT ,
   IS_ONLY_SHOW_DETAIL ,
   IS_IND              ,
   SORT_NO             ,
   SORT_TYPE           ,
   IS_ASC    from UR_ZTEMP_1;
   
drop table UR_ZTEMP_1;