記一次使用utl_http方法調用介面,報字元或值錯誤

來源:互聯網
上載者:User

標籤:介面   stop   sage   end   bms   etl   方法   限制   buffer   

背景:ebs系統和其他系統通過utl_http包調用介面,使用log方法記錄日誌。

某次調用介面,執行到記錄日誌行報字元或值錯誤。

尋找原因,發現是p_str的長度超過的32747的限制。

解決辦法:

 PROCEDURE log(p_str VARCHAR2) IS  BEGIN    fnd_file.put_line(fnd_file.log, p_str);    dbms_output.put_line(p_str);  END;
--解決l_messge_clob長度超過3276導致的溢出問題,字元或值錯誤FOR i IN 0 .. trunc((dbms_lob.getlength(l_messge_clob) - 1) / l_step) LOOP  log(dbms_lob.substr(l_messge_clob, l_step, i * l_step + 1));END LOOP;--同樣 utl_http.write_text 長度不能超過32767,buffer       VARCHAR2(2000);offset       NUMBER := 1;amount       NUMBER := 1024;--解決l_messge_clob長度超過3276導致的溢出問題,字元或值錯誤---utl_http.write_text(l_req, p_content);WHILE (offset < v_req_length) LOOP  dbms_lob.read(p_content, amount, offset, buffer);  utl_http.write_text(r => l_req, data => buffer);  offset := offset + amount;END LOOP;

參考:

utl_http request and response stops when  > 32k

UTTL_HTTP to POST CLOB request

http://www.orafaq.com/forum/t/202946/

記一次使用utl_http方法調用介面,報字元或值錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.