If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > SELECT returns more than one row

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-11-10, 16:33
83dons 83dons is offline
Registered User
 
Join Date: Jan 2010
Posts: 5
SELECT returns more than one row

Hi

I am using a simple Pass Through Query in MS Access to pull data from a Sybase database and populate a table in Access. This query has always worked in the past but has recently been throwing back the following error message:

ODBC -- call failed.
[Sybase][ODBC Driver][Adaptive Server Anywhere]SELECT returns more than one row(#-185)

I have not changed the query so I am guessing this must be down to a data limit for the query being reached, a time out in connection or perhaps a duplicate row in the database or maybe a wrongly populated row?

I have tried the google search and found nothing to help - the table in Access did have a lot of rows at about 380,000 but it should manage more than this I reckon as the limit for an Access table is 2GB. Cananyone help please? Spent 2 days on this already! Maybe an alternative SQL query is needed. The current query is somehing like:

SELECT column1, column2, ...etc
FROM tablename;

SO basically selects all rows in a table in Sybase and certain columns and then puts them in an Access table.
Reply With Quote
  #2 (permalink)  
Old 01-12-10, 02:15
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,258
Maybe your data changed and now you do have more than one row returning from a sub select
Reply With Quote
  #3 (permalink)  
Old 01-12-10, 04:47
83dons 83dons is offline
Registered User
 
Join Date: Jan 2010
Posts: 5
So what would the best way to solve this be? I guess your implying there is no primary key on the sybase table?

The Sybase table is in fact a view does this make any difference?
Reply With Quote
  #4 (permalink)  
Old 01-12-10, 04:47
aflorin27 aflorin27 is offline
Registered User
 
Join Date: Apr 2008
Location: Iasi, Romania
Posts: 304
Usualy this type of error appears when you have a sub-select in a WHERE clause
__________________
Florin Aparaschivei
Iasi, Romania
Reply With Quote
  #5 (permalink)  
Old 01-12-10, 06:21
83dons 83dons is offline
Registered User
 
Join Date: Jan 2010
Posts: 5
but there is no where clause here
Reply With Quote
  #6 (permalink)  
Old 01-12-10, 07:35
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,258
Show us the sql, maybe we can help.
Reply With Quote
  #7 (permalink)  
Old 01-12-10, 14:09
83dons 83dons is offline
Registered User
 
Join Date: Jan 2010
Posts: 5
Access Pass Through Query:

SELECT *
FROM OPASAttendances_View;

As I said this worked fine before, I just dont know how the query could suddenly be returning multiple rows?
Reply With Quote
  #8 (permalink)  
Old 01-12-10, 14:19
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,085
Quote:
Originally Posted by 83dons View Post
SELECT *
FROM OPASAttendances_View;
[sigh!!!] please show us the view
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #9 (permalink)  
Old 01-12-10, 19:06
83dons 83dons is offline
Registered User
 
Join Date: Jan 2010
Posts: 5
What do you need to see from the view? I dont have direct access to the Sybase server only through ISQL.
Reply With Quote
  #10 (permalink)  
Old 01-12-10, 20:21
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,085
Quote:
Originally Posted by 83dons View Post
What do you need to see from the view?
whether it has a subquery
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On