Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Using EF SQL Anywhere Data Provider a linq query fails on retrieving data from a proxy table. It only fails if the query results in more than one rows.

  InnerException: iAnywhere.Data.SQLAnywhere.SAException
       Message=Cursor is restricted to FETCH NEXT operations
       Source=SQL Anywhere .NET Data Provider
       ErrorCode=-2147467259
       NativeError=-668
       StackTrace:
            at iAnywhere.Data.SQLAnywhere.SADataReader.Read()
            at System.Data.Common.Internal.Materialization.Shaper`1.StoreRead()

Both the databases (the one in which the query is run and the remote server) are SA12 (12.0.1.3742) databases. If I copy the proxy table (structure and data) and replace it as an ordinary table, the query is run with success.

This leads me towards the issue being with the EF data provider which turns the query to a cursor declaration which fails.

Linq Query:

var obPersonFiles = (from files in sybaseModel.OB_PERSON_FILE
                      where files.EMPLOYMENT_SEQ == employmentSeq && files.DOCUMENT != null
                     select files).ToList();

Table structure:

alt text

asked 09 Oct '12, 05:44

OBR's gravatar image

OBR
291101122
accept rate: 0%

edited 15 Mar '13, 21:10

Mark%20Culp's gravatar image

Mark Culp
24.9k10141297

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×70
×69
×24
×2

question asked: 09 Oct '12, 05:44

question was seen: 2,838 times

last updated: 15 Mar '13, 21:10