/*
================================================================================
档案代号:icr_file
档案名称:ICD自动编码规则资料档
档案目的:
上游档案:
下游档案:
============.========================.==========================================
*/
create table icr_file
(
icr01       varchar2(10) NOT NULL,   /*编码原则代号                           */
icr02       varchar2(1) NOT NULL,    /*编号性质                               */
                                     /*1. BODY MASK  2. LAYER MASK 3. CODE MASK 4. wafer 料号/制程料号 
5.datecode*/
icr03       number(5) NOT NULL,      /*顺序                                   */
icr04       varchar2(1),             /*编码型态                               */
                                     /*1. 固定值 2. 定义值 3.流水号           */
icr05       varchar2(10),            /*固定值                                 */
icr06       varchar2(20),            /*资料表名称                             */
                                     /*1.sfb_file.sfb81                       */
icr061      varchar2(10),            /*栏位名称                               */
icr07       varchar2(5),             /*码数                                   */
icr08       varchar2(1)              /*日期性质                               */
                                     /*1.年周 2.年月周 3.年月日               */
);

create unique index icr_pk on icr_file (icr01,icr02,icr03);
alter table icr_file add  constraint icr_pk primary key  (icr01,icr02,icr03) enable validate;
grant select on icr_file to public;
grant index on icr_file to public;
grant update on icr_file to public;
grant delete on icr_file to public;
grant insert on icr_file to public;