Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
269 views
in Technique[技术] by (71.8m points)

Cannot fetch a rows from oracle (linked server) using openquery in sql server

I am rewriting a replication package between oracle and sql server. Currently the data is moved by ssis packages, but we move towards stored procedures because of better performance and easier maintenance.

I get the following error when I try to fetch rows from oracle using openquery in sql server.

""OLE DB provider "MSDASQL" for linked server "" returned message "[oracle_db_name][ODBC 64bit driver][OpenAccess SDK SQL Engine]Failed to retrieve data. Error ticket# kkfiquod1il1svbg21nxw[401]". OLE DB provider "MSDASQL" for linked server "" returned message "[oracle_db_name][ODBC 64bit driver]Error in row.". Msg 7330, Level 16, State 2, Line 2 Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "".""

The column that is causing the issue is an ntext column in oracle, I have tried to cast it in many ways, nothing.

Interestingly if I use LEFT(NVL(Column_Name, ''''), 4000) on the problematic column it returns some rows - the first 100 - or it returns lot more if I order my results by the id, but I can not get all.

When I located the 'last' id from the batch that did not fail and selected the next id's row the column was null just as some of the previous rows.

Is anyone ever experienced similar or have a solution for this issue?

Thanks in advance!

question from:https://stackoverflow.com/questions/65922020/cannot-fetch-a-rows-from-oracle-linked-server-using-openquery-in-sql-server

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...