Professional Documents
Culture Documents
8) */
DECLARE
p1 CLOB;
p2 CLOB;
p3 CLOB;
num NUMBER;
CURSOR cur1
IS
SELECT MAX (message_num)
FROM rms.rib_message;
CURSOR c1
IS
CURSOR c2
IS
BEGIN
OPEN cur1;
FETCH cur1
INTO num;
CLOSE cur1;
FOR i IN c2
LOOP
p1 :=
'<?xml version="1.0" encoding="UTF-8"?><ASNOutDesc><to_location>'
|| i.to_loc
|| '</to_location><from_location>'
|| i.from_loc
|| '</from_location><asn_nbr>'
|| i.tsf_no
||
'</asn_nbr><asn_type>C</asn_type><container_qty>1</container_qty><bol_nbr>'
|| i.tsf_no
|| '</bol_nbr><shipment_date><year>'
|| i.YEAR
|| '</year><month>'
|| i.MONTH
|| '</month><day>'
|| i.DAY
||
'</day><hour>22</hour><minute>5</minute><second>55</second></shipment_date><ship_ad
dress1></ship_address1><ship_address2></ship_address2><ship_address3></
ship_address3><ship_address4></ship_address4><ship_address5></
ship_address5><ship_city></ship_city><ship_state></ship_state><ship_zip></
ship_zip><ship_country_id></ship_country_id><trailer_nbr></
trailer_nbr><seal_nbr></seal_nbr><carrier_code></
carrier_code><transshipment_nbr></transshipment_nbr><ASNOutDistro><distro_nbr>'
|| i.tsf_no
||
'</distro_nbr><distro_doc_type>T</distro_doc_type><customer_order_nbr></
customer_order_nbr><consumer_direct></consumer_direct><ASNOutCtn><final_location>'
|| i.to_loc
|| '</final_location><container_id>'
|| i.tsf_no
||
'-1</container_id><container_weight>0</container_weight><container_length>0</
container_length><container_width>0</container_width><container_height>0</
container_height><container_cube>0</container_cube><expedite_flag></
expedite_flag><rma_nbr></rma_nbr><tracking_nbr></tracking_nbr><freight_charge>0</
freight_charge><master_container_id></master_container_id>';
FOR j IN c1
LOOP
p2 :=
'<ASNOutItem><item_id>'
|| j.id_itm
|| '</item_id><unit_qty>'
|| j.qu_itm
||
'</unit_qty><priority_level>0</priority_level><order_line_nbr>0</order_line_nbr><lo
t_nbr></lot_nbr><final_location>'
|| j.id_prty_fm_icd
||
'</final_location><from_disposition></from_disposition><to_disposition></
to_disposition><voucher_number></voucher_number><container_qty>1</container_qty></
ASNOutItem>';
p3 := '</ASNOutCtn></ASNOutDistro></ASNOutDesc>';