开发者

Convert from Oracle VARCHAR2 to MySQL TEXT

开发者 https://www.devze.com 2022-12-19 05:14 出处:网络
How to do correct conversion of data from Oracle VARCHAR2 type to MySQL TEXT type? I want insert it into mysql table in field with TEXT type开发者_如何学JAVA through DBLink.Something like this might

How to do correct conversion of data from Oracle VARCHAR2 type to MySQL TEXT type? I want insert it into mysql table in field with TEXT type开发者_如何学JAVA through DBLink.


Something like this might work. I wasn't sure which way you are going but the Oracle package dbms_lob will convert varchar2 to various BLOB, LOB, CLOB formats.

You might need to use a temporary table to pull source data to target side first if there are problems with the database link.

insert into database.target_table@DBLINK(text1, text2)
select 
  dbms_lob.substr(s.text1, 4000, 1),
  dbms_lob.substr(s.text2, 4000, 1)
from 
  source_table s;
0

精彩评论

暂无评论...
验证码 换一张
取 消