/*
================================================================================
档案代号:apsapg
档案名称:APS 万用取替代
档案目的:
上游档案:
下游档案:
============.========================.==========================================
*/
create table apsapg
(
in_pid      varchar2(40) NOT NULL,   /*元件编号                               */
sub_pid     varchar2(32) NOT NULL,   /*取替代料品号                           */
sb_aprio    number(4),               /*取替代优先顺序                         */
in_qty      number(16,4),            /*投入量                                 */
eff_st      date,                    /*生效日                                 */
eff_et      date,                    /*失效日                                 */
out_qty     number(16,4),            /*产出量                                 */
shrink      number(16,4),            /*损耗率                                 */
sub_type    number(4),               /*取替代属性                             */
al_ratio    number(16,4)             /*以bom为主设定的替代比率                */
);

create unique index apsapg_pk on apsapg (in_pid,sub_pid);
alter table apsapg add  constraint apsapg_pk primary key  (in_pid,sub_pid) enable validate;
grant select on apsapg to public;
grant index on apsapg to public;
grant update on apsapg to public;
grant delete on apsapg to public;
grant insert on apsapg to public;