/*
================================================================================
档案代号:sgyi_file
档案名称:工单制程单元变更档
档案目的:工单工艺单元变更单身档
上游档案:
下游档案:
============.========================.==========================================
*/
create table sgyi_file
(
sgyi01      varchar2(16) DEFAULT '' NOT NULL, /*工单编号*/
sgyi02      number(5) DEFAULT '0' NOT NULL, /*工艺序*/
sgyi03      number(5) DEFAULT '0' NOT NULL, /*变更序号*/
sgyi05      varchar2(10) DEFAULT '' NOT NULL, /*单元编号*/
sgyislk01   number(10),              /*原单元顺序                             */
sgyislk03   number(8,4),             /*原现实工时                             */
sgyislk04   number(20,6),            /*原标准工价                             */
sgyislk05   number(20,6),            /*原现实工价                             */
sgyislk06   number(10),              /*新单元顺序                             */
sgyislk08   number(8,4),             /*新现实工时                             */
sgyislk09   number(20,6),            /*新标准工价                             */
sgyislk10   number(20,6)             /*新现实工价                             */
);

create unique index sgyi_pk on sgyi_file (sgyi01,sgyi02,sgyi03,sgyi05);
alter table sgyi_file add  constraint sgyi_pk primary key  (sgyi01,sgyi02,sgyi03,sgyi05) enable validate;
grant select on sgyi_file to public;
grant index on sgyi_file to public;
grant update on sgyi_file to public;
grant delete on sgyi_file to public;
grant insert on sgyi_file to public;