sql server linked server to oracle returns no data found when data exists -


i have linked server setup in sql server hit oracle database. have query in sql server joins on oracle table using dot notation. getting “no data found” error oracle. on oracle side, hitting table (not view) , no stored procedure involved.

first, when there no data should 0 rows , not error.
second, there should data in case.
third, have seen ora-01403 error in pl/sql code; never in sql.

this full error message:
ole db provider "oraoledb.oracle" linked server "om_oracle" returned message "ora-01403: no data found".
msg 7346, level 16, state 2, line 1 cannot data of row ole db provider "oraoledb.oracle" linked server "om_oracle".

here more details, not mean since don’t have tables , data.
query problem:

select *    eopf.batch b join eopf.batchfile bf                  on b.batchid = bf.batchid           left outer join [om_oracle]..[om].[document_upload] du                  on bf.referenceid = du.documentuploadid; 




can’t understand why “no data found” error. query below uses same oracle table , returns no data don’t error - no rows returned.

select * [om_oracle]..[om].[document_upload] documentuploadid = -1 



query below returns data. removed 1 of sql server tables join. removing batch table not change rows returned batchfile (271 rows in both cases – rows in batchfile have batch entry). should still joining same batchfile rows same oracle rows.

select * eopf.batchfile bf    left outer join [om_oracle]..[om].[document_upload] du       on bf.referenceid = du.documentuploadid; 



, query returns 5 rows. should same 5 original query. ( can’t use because need data batch , batchfile table).

       select *    [om_oracle]..[om].[document_upload] du    du.documentuploadid    in    (    select bf.referenceid    eopf.batch b join eopf.batchfile bf                  on b.batchid = bf.batchid); 

has experienced error?

today experienced same problem inner join. creating table valued function suggested codechurn or using temporary table suggested user1935511 or changing join types suggested cymorg no options me, share solution.

i used join hints drive query optimizer right direction, problem seems rise nested loops join strategy remote table locally . me hash, merge , remote join hints worked.

for remote not option because can used inner join operations. using following should work.

select * eopf.batch b join eopf.batchfile bf   on b.batchid = bf.batchid left outer merge join [om_oracle]..[om].[document_upload] du   on bf.referenceid = du.documentuploadid; 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -