create or replace procedure SP_GET_ITEMDETAIL(P_ORDER_ID IN STRING,P_ITEM_DETAIL_STR OUT STRING) is
/**
* 快递计费 获取发货单明细
* 2016-03-04  scrazy
*/  
CURSOR CUR_ITEM_DETAILS IS 
  SELECT * FROM WMS_DELIVER_DOCUMENT_DETAIL D WHERE D.ORDER_ID = P_ORDER_ID;
  R_ITEM_DETAIL CUR_ITEM_DETAILS%ROWTYPE;
begin
  P_ITEM_DETAIL_STR := NULL;
  OPEN CUR_ITEM_DETAILS;
  LOOP
    FETCH CUR_ITEM_DETAILS INTO R_ITEM_DETAIL;
    IF CUR_ITEM_DETAILS%NOTFOUND THEN
      EXIT;
    END IF;
    P_ITEM_DETAIL_STR := P_ITEM_DETAIL_STR||','||R_ITEM_DETAIL.ITEM_NAME ||':'||R_ITEM_DETAIL.QUANTITY;
  END LOOP;
  CLOSE CUR_ITEM_DETAILS;
  IF P_ITEM_DETAIL_STR IS NOT NULL THEN
    P_ITEM_DETAIL_STR := SUBSTR(P_ITEM_DETAIL_STR,2);
  END IF;
end SP_GET_ITEMDETAIL;