Generated statement contains SQL parameter as constant in column selection (causes "Data type unknown" error) -------------------------------------------------------------------------------------------------------------
Key: DNET-345 URL: http://tracker.firebirdsql.org/browse/DNET-345 Project: .NET Data provider Issue Type: Bug Components: Entity Framework support Affects Versions: 2.5.2 Reporter: Daniel Richter Assignee: Jiri Cincura Some queries result in generated SQL containing projections with an SQL parameter as constant in column selection. E.g. SELECT @p__linq__2 AS "p__linq__2" FROM Table1 which results in a "Data type unknown" error. Containing an explicit cast. the statement is executable: SELECT CAST(@p__linq__2 AS TIMESTAMP) AS "p__linq__2" FROM Table1 I can reproduce it by using a filter with a captured parameter and a grouping followed by a projection selecting both a group aggregate and the group itself: DateTime dateTime = DateTime.Now; var query = this.objectContext.TABLE1 .Select(entity => new { entity.SomeDateTime, entity.SomeValue1, entity.SomeValue2 }) .Where(entity => entity.SomeDateTime>dateTime) .GroupBy(entity => entity.SomeValue1) .Select(group => new { Sum = group.Sum(entity => entity.SomeValue2), Values = group }) .ToList(); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider