You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling the DbFunctions method
CreateDateTime(int? year,int? month,int? day,int? hour,int? minute,double? second)
generates SQL code that is not executable.
The SQL generating method (HandleCanonicalFunctionCreateDateTime) assumes that all parameters are constants and all parameters are not null. Additionally, the parameter for seconds is of type double so the generated SQL contains a CAST inside a timestamp literal (so it won't work even if all parameters a non-null constants).
The call DbFunctions.CreateDateTime(2020,3,19,12,0,0) is translated to
CAST('2020-3-19 12:0:CAST(0 AS DOUBLE PRECISION)' AS TIMESTAMP)
The call DbFunctions.CreateDateTime(2020,3,19,null,null,null) is translated to
CAST('2020-3-19 NULL:NULL:NULL' AS TIMESTAMP)
The call DbFunctions.CreateDateTime(c.BirthYear,1,1,null,null,null) is translated to
CAST('"C"."BIRTHYEAR"-1-1 NULL:NULL:NULL' AS TIMESTAMP)
The text was updated successfully, but these errors were encountered:
Submitted by: Daniel Richter (drichter)
Calling the DbFunctions method
CreateDateTime(int? year,int? month,int? day,int? hour,int? minute,double? second)
generates SQL code that is not executable.
The SQL generating method (HandleCanonicalFunctionCreateDateTime) assumes that all parameters are constants and all parameters are not null. Additionally, the parameter for seconds is of type double so the generated SQL contains a CAST inside a timestamp literal (so it won't work even if all parameters a non-null constants).
The call DbFunctions.CreateDateTime(2020,3,19,12,0,0) is translated to
CAST('2020-3-19 12:0:CAST(0 AS DOUBLE PRECISION)' AS TIMESTAMP)
The call DbFunctions.CreateDateTime(2020,3,19,null,null,null) is translated to
CAST('2020-3-19 NULL:NULL:NULL' AS TIMESTAMP)
The call DbFunctions.CreateDateTime(c.BirthYear,1,1,null,null,null) is translated to
CAST('"C"."BIRTHYEAR"-1-1 NULL:NULL:NULL' AS TIMESTAMP)
The text was updated successfully, but these errors were encountered: