日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

dblink传输clob字段

發布時間:2024/9/19 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 dblink传输clob字段 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言

  • 觸發器中需要通過dblink更新另一個數據庫中的數據
  • 兩邊的字段均為clob類型

據說有三種解決方案

https://blog.csdn.net/daxiang12092205/article/details/19751305

解決辦法

根據我的實際情況,選擇截取clob中前4000個字符。

CREATE OR REPLACE TRIGGER ttttt123 BEFORE UPDATEON table1REFERENCING OLD AS OLD NEW AS NEWFOR EACH ROW DECLAREv_tmpCustomerDescription varchar2(4000); BEGIN if (:NEW.customer_description is not null ) then v_tmpCustomerDescription := dbms_lob.substr(:NEW.customer_description,4000,1);update table2@dblink1 t2 set t2.customer_description=v_tmpCustomerDescription where t2.orderno=:NEW.orderno;end if; end;

遇到的問題

Oracle ORA-02069: 此操作的 global_names 參數必須設置為 TRUE

下面的寫法會導致 ORA-02069 錯誤:

update table2@dblink1 t2 set t2.customer_description=dbms_lob.substr(:NEW.customer_description,4000,1) where t2.orderno=:NEW.orderno;

更正寫法:

v_tmpCustomerDescription := dbms_lob.substr(:NEW.customer_description,4000,1); update table2@dblink1 t2 set t2.customer_description=v_tmpCustomerDescription where t2.orderno=:NEW.orderno;

參考

https://blog.csdn.net/daxiang12092205/article/details/19751305
https://blog.csdn.net/gavinloo/article/details/6830524
https://bbs.csdn.net/topics/390802878

總結

以上是生活随笔為你收集整理的dblink传输clob字段的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。