/*
================================================================================
档案代号:sgv_file
档案名称:产品制程单元变更档
档案目的:产品工艺单元变更单头档
上游档案:
下游档案:
============.========================.==========================================
*/
create table sgv_file
(
sgv01       varchar2(40) DEFAULT '' NOT NULL, /*产品料号*/
sgv02       varchar2(10) DEFAULT '' NOT NULL, /*制程编号*/
sgv03       number(5) DEFAULT '0' NOT NULL, /*制程序号*/
sgv04       number(5) DEFAULT '0' NOT NULL, /*单元变更序号*/
sgv05       varchar2(10),            /*变更原因                               */
sgv06       varchar2(80),            /*变更原因说明                           */
sgv07       date DEFAULT sysdate NOT NULL, /*变更日期*/
sgv08       date,                    /*发放日期                               */
sgv09       varchar2(1) DEFAULT '' NOT NULL, /*审核码*/
sgv10       varchar2(1),             /*发放码                                 */
sgvacti     varchar2(1),             /*资料有效码                             */
sgvdate     date,                    /*最近修改日                             */
sgvgrup     varchar2(10),            /*资料所属群组                           */
sgvmodu     varchar2(10),            /*资料修改者                             */
sgvuser     varchar2(10)             /*资料所有者                             */
);

create unique index sgv_pk on sgv_file (sgv01,sgv02,sgv03,sgv04);
alter table sgv_file add  constraint sgv_pk primary key  (sgv01,sgv02,sgv03,sgv04) enable validate;
grant select on sgv_file to public;
grant index on sgv_file to public;
grant update on sgv_file to public;
grant delete on sgv_file to public;
grant insert on sgv_file to public;