저장 프로세스 - 조회 데이터가 커서에 삽입된 후 테이블 필드 업데이트

1523 단어 저장 프로세스
create or replace procedure p_update_03
as
 type balance is ref cursor;
 balanceDaylly balance;
 dealer_code VARCHAR2(70);--     
 delivery_carrier VARCHAR2(10);--  
 carrier_code VARCHAR2(32);--     
 DEALER_NUMBER VARCHAR2(20);--   
 serial_no VARCHAR2(32);
 begin
   open balanceDaylly for 
    select carrier.code,carrier.name,s.license,s.driver_name,pd.serial_no from jac_scl.shipment_detail sd 
    left join jac_scl.shipment s on s.id = sd.shipment_id
    left join jac_scl.pod_detail pd on pd.id = sd.pod_detail_id
    left join jac_scl.Wms_Organization carrier on carrier.id = s.carrier_id
    where pd.serial_no in ('E3004185','E8011988','E8011992');
   loop
     fetch balanceDaylly into carrier_code,dealer_code,DEALER_NUMBER,delivery_carrier,serial_no;
     exit when balanceDaylly%notfound;
     dbms_output.put_line(carrier_code||','||dealer_code||','||DEALER_NUMBER||','||delivery_carrier||','||serial_no);
     update pod_detail pp set pp.description = delivery_carrier  
            where pp.serial_no = serial_no;
     end loop; 
 end;
  
  --  
   begin  
      p_update_03;  
   end; 
  --  
H,   **        ,, ××,E8011992
B,  **      ,, ×,E3004185
B,  **      ,, ×,E8011992
B,  **      ,, ×,E8011988
  -- pod_detail   description    

좋은 웹페이지 즐겨찾기