?
Solved

linked server problem

Posted on 2011-03-15
12
Medium Priority
?
271 Views
Last Modified: 2012-05-11
hi,
when trying to read view from oracle 9 DB with sql 2005 linked server i get null (there is no error but no data )  but when i run the select on a table i get the data .
 
thx
 
0
Comment
Question by:Hazera_Genetics_IT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35138681
please show the query you run.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35138686
and also the relevant table structure from your oracle database
0
 

Author Comment

by:Hazera_Genetics_IT
ID: 35138781
for the table : select *  FROM [test2]..[APPLSYS].[FND_OAM_CHARTS]

for the view is : select *  FROM [test2]..[APPLSYS].[xx_orders_for_qv_v ]
                         where a.order_number='106179'
what do you mean  table structure ?                      
0
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35138801
>where a.order_number='106179'

if the field in the oracle table is CHAR, this could be the reason.
if the field is numerical, try:
where a.order_number= 106179

>what do you mean  table structure ?                
the columns with the data types (DESC tablename in oracle)
0
 
LVL 57

Expert Comment

by:HainKurt
ID: 35138886
do you get any data for this

select *  FROM [test2]..[APPLSYS].[xx_orders_for_qv_v ]
0
 
LVL 57

Expert Comment

by:HainKurt
ID: 35138909
or any data for this:

select * FROM [test2]..[APPLSYS].[xx_orders_for_qv_v ] where a.order_number=106179

or for this

select * FROM [test2]..[APPLSYS].[xx_orders_for_qv_v ] where trim(a.order_number)='106179'


0
 

Author Comment

by:Hazera_Genetics_IT
ID: 35139554
i think i found the problem . something to do with Initialize the org ID .
i run the select on a view that dosnt need the  Initialize  and its working fine.

do you have any idea ?
0
 
LVL 57

Expert Comment

by:HainKurt
ID: 35140084
what does this mean "Initialize the org ID"
0
 

Author Comment

by:Hazera_Genetics_IT
ID: 35140888
in plsql we need to run ascript if we want to open view .
/*Begin

--  Fnd_Global.APPS_Initialize(user_id => xxxx, resp_id => xxxxx, resp_appl_id => xxx);

--  Dbms_application_info.set_client_info (83);

  fnd_client_info.set_org_context(83);

End;*/

we need to do the same in ms sql but the syntex is not the same .
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35141478
I fear you cannot do this via the linked server ...
you need to create some "wrapper" for the view, on oracle side, or some view that does not need to have this context set .
0
 

Author Comment

by:Hazera_Genetics_IT
ID: 35145966
do you mean that i need to run it on the oracle DB ?
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 35146139
as you cannot run this nd_client_info.set_org_context(83); via the linked server, you cannot run the view part via linked server neither, as visibly, the view is basing itself on that.

you need to check with the (oracle) DBA if he sees an alternative..
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to take different types of Oracle backups using RMAN.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question