dblink传输clob字段
生活随笔
收集整理的這篇文章主要介紹了
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字段的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 读速 7400 MB/s:雷克沙 4TB
- 下一篇: 宝马明年将在英国推出 L2 + 级辅助驾