Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Copy Tables having clob fields from Oracle Database to SQL database

User_XAOTDApr 9 2019 — edited Apr 11 2019

Hello,

I tried to copy tables with clob fields from Oracle Database to SQL database using Linked Server created at SQL server connects to Oracle database with the following Query :

select * into  TDM_CONFLICT_LOG from openquery(MUS1, 'select * from SOLIDWORKS.TDM_CONFLICT_LOG')

Here, TDM_CONFLICT_LOG is my SQL table name [table get created after running above Query]where i want to copy all records of table from Oracle

MUS1 is linked server which connects SQL to oracle

SOLIDWORKS.TDM_CONFLICT_LOG is my Oracle Table name.

With this Query, I am able to copy tables from Oracle database to SQL database but Only CLOB columns are not copied correctly to SQL.

I am also able to copy CLOB Fields which have length <4000 correctly from Oracle to SQL with following Query:-

select CONFLICT_ID,CONFLICT_DATA into  TDM_CONFLICT_LOG from openquery(MUS1, 'select CONFLICT_ID, TO_CHAR(CONFLICT_DATA) as CONFLICT_DATA from SOLIDWORKS.TDM_CONFLICT_LOG where length(CONFLICT_DATA)<4000')

In Above Query, CONFLICT_DATA  is CLOB COLUMN.

But I cann't able to copy CLOB fields having length > 4000. How i can copy it correctly.

Can you please give us solution on it? How we can successfully Copied tables from oracle to SQL?

Thanks and Regards

Comments
Post Details
Added on Apr 9 2019
9 comments
2,360 views