Page 1 of 1

Canonical Functions - EntityFunctions.TruncateTime

Posted: Fri 26 Nov 2010 15:24
by rick.duarte
I'm trying to execute a query that uses a canonincal function EntityFunctions.TruncateTime and I'm getting an error ORA-00904.

Here is the Linq:

Code: Select all

var logoffs = from off in ctxSiebel.DbaAuditTrails
              where off.Timestamp >= semana.DtInicioSemana
              && EntityFunctions.TruncateTime(off.Timestamp) = :p__linq__0) AND ((TruncateTime("Extent1".TIMESTAMP)) <= :p__linq__1)
	GROUP BY "Extent1".TIMESTAMP
)  "GroupBy1"
I'm using version: 5.70.190.
What is worng? Canonical functions are not supported?

Best Regards,

Henrique

Posted: Fri 26 Nov 2010 17:24
by AndreyR
Use the following code instead:

Code: Select all

var logoffs = from off in ctxSiebel.DbaAuditTrails 
              where off.Timestamp >= semana.DtInicioSemana 
              && Devart.Data.Oracle.Entity.OracleFunctions.Trunc(off.Timestamp) <= semana.DtFimSemana 
              group off by off.Timestamp into g 
              select new db.MonitoramentoLogin 
              { 
                  DtColeta = g.Key, 
                  NrLogoff = g.Count() 
              };
Please note that you need to add a reference to the Devart.Data.Oacle.Entity.dll assembly to your project.

Posted: Fri 26 Nov 2010 19:19
by rick.duarte
Thanks!

Posted: Mon 24 Jan 2011 16:43
by AndreyR
We have fixed the problem, the initial syntax will be working in the nearest build as well.

Posted: Fri 18 Feb 2011 10:46
by AndreyR
We have released a new 6.10.103 build of dotConnect for Oracle.
It can be downloaded from this page (Trial Edition) or from Registered Users' Area (non-Trial Editions).