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 (188.8.131.5242) 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.
var obPersonFiles = (from files in sybaseModel.OB_PERSON_FILE where files.EMPLOYMENT_SEQ == employmentSeq && files.DOCUMENT != null select files).ToList();