Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

OPENQUERY COUNT VERSUS OPENQUERY SELECT Expand / Collapse
Author
Message
Posted Tuesday, August 09, 2011 4:22 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, August 19, 2011 11:01 AM
Points: 3, Visits: 3
Hi masters!!! It's my first time here. Please, forgive my poor knowledge.
I've got a working linked Server with Oracle, but one problem:
When I execute a count query it gives me the right answer, but, when I execute a simple select to retrieve the data, it gives me just a part of my count.

SELECT * FROM OPENQUERY(myserver,'SELECT COUNT(*) FROM mytable') ==> This count returns 349, that is the number of lines in my table.
SELECT * FROM OPENQUERY(myserver,'SELECT * FROM mytable') ==> This select returns only 250 lines, that is a part of my table.

Please, can you help me with this scenario?
It would have the same result (349 lines instead of 250).
Thank you so very much (in advance)...
Post #1157335
Posted Wednesday, August 10, 2011 9:04 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, August 19, 2011 11:01 AM
Points: 3, Visits: 3
Hi masters!!!
Finally I found an answer.
I've just changed the (linkedserver properties) @srvproduct that was ODBC, to ORACLE and now it works fine.
Thank you so very much. I hope someone could use this.
Post #1157716
Posted Wednesday, August 10, 2011 9:09 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Thursday, January 16, 2014 12:03 PM
Points: 21,376, Visits: 9,594
neocoolio (8/10/2011)
Hi masters!!!
Finally I found an answer.
I've just changed the (linkedserver properties) @srvproduct that was ODBC, to ORACLE and now it works fine.
Thank you so very much. I hope someone could use this.


Thanks for the feedback. How does that explain the differente behavior? Got a link that explains this?
Post #1157720
Posted Friday, August 19, 2011 11:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, August 19, 2011 11:01 AM
Points: 3, Visits: 3
Sorry... I don't know any link to explain the scenario.
I just compared my linkedserver with a friend's one and noticed that the @srvproduct was different. Then I changed this property and it has worked very well.
Unfortunately I don't have further information. Sorry again...
Post #1162682
Posted Wednesday, June 13, 2012 12:06 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 8:40 AM
Points: 351, Visits: 1,654
I am also facing the same problem, but even though i chnaged the @srvproduct=N'oracle', its not returning all the rows. Any clue?
Post #1315369
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse