|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
procedure vendor_in is
begin
for rec in (select * from RZ_PO_VENDOR_TEMP) loop
INSERT INTO ap_suppliers_int
(
vendor_interface_id,
vendor_name,
segment1,
vendor_name_alt,
last_update_date,
last_updated_by,
creation_date,
created_by,
enabled_flag,
vendor_type_lookup_code,
ship_to_location_id,
bill_to_location_id,
terms_id,
allow_awt_flag,
awt_group_name,
match_option,
payment_priority,
terms_date_basis,
pay_date_basis_lookup_code,
payment_method_lookup_code,
attribute1,
vat_registration_num
)
VALUES
(
ap_suppliers_int_s.nextval,
rec.vendor_name,
rec.vendor_code,
rec.vendor_sname,
SYSDATE,
-1,
SYSDATE,
-1,
'Y',
'VENDOR',
204,
204,
10000,
'N',
NULL,
'P',
99,
'Invoice',
'DUE',
'CHECK',
rec.xh,
rec.tax_code
);
end loop;
COMMIT;
end ;
procedure vendor_site_in is
begin
update RZ_PO_VENDOR_TEMP
set vendor_id = (select vendor_id from po_vendors
where attribute1=RZ_PO_VENDOR_TEMP.xh)
;
update RZ_PO_VENDOR_TEMP
set vendor_iid = (select vendor_interface_id from ap_suppliers_int
where attribute1=RZ_PO_VENDOR_TEMP.xh)
;
commit;
for rec in (select * from RZ_PO_VENDOR_TEMP) loop
INSERT INTO ap_supplier_sites_int
(
vendor_interface_id,
vendor_id,
vendor_site_code,
last_update_date,
last_updated_by,
creation_date,
created_by,
address_line1,
address_line2,
address_line3,
address_line4,
city,
state,
area_code,
phone,
ship_to_location_id,
bill_to_location_id,
inactive_date,
terms_id,
org_id
)
VALUES
(
rec.vendor_iid,
rec.vendor_id,
rec.vendor_code,
SYSDATE,
1318,
SYSDATE,
1318,
rec.addr,
rec.adde_det,
'',
'',
rec.city,
rec.country,
rec.zipcode,
rec.phone,
204,
204,
null,
10000,
204
);
end loop;
COMMIT;
end ;
导入供应商时有两个表ap_suppliers_int和ap_supplier_sites_int
在第一个表里面没有VENDOR_ID这个字段,在第二个表里面有,是不是表示这两部分是先后进行的。
就是先将数据导入供应商,然后取得相关供应商的ID,然后导入供应商的位置,可是我为什么导入供应商完成了但是却无法导入第二个表,也没有报错,只是说导入0 |
|