none
Need List of supported TSQL functions in Entity SQL / ObjectQueries RRS feed

  • Question

  • Hi,

    how can I find out which TSQL functions are available in Entity SQL respectively Object queries?

    For example

    ObjectQuery<Employee> query =
                    context.EmployeeSet
                    .Where("MONTH(it.BirthDate) = 2 and YEAR(it.BirthDate) = 1972");

    is supported,

    ObjectQuery<Employee> query =
                    context.EmployeeSet
                    .Where("MONTH(it.BirthDate) = 2 and (YEAR(GETDATE()) - YEAR(it.BirthDate)) > 40");

    is not.

    so, month() and year() would work, while getdate() won't.
    How can I fond out, which functions can be used?

    Thanks in advace
    Anja

    Wednesday, February 15, 2012 10:48 AM

Answers

  • Hello Anja,

    what you are using in ESQL are not direct functions from TSQL. Those functions are called cannonical functions - shared set of functions translated to common functions in all database systems. Those functions don't operate on database directly. They operate on your entities. The list of cannonical functions in ESQL can be found here. You are probably looking for CreateDataTime() cannonical function.

    Best regards,
    Ladislav

    • Marked as answer by Anja Länge Wednesday, February 15, 2012 11:18 AM
    Wednesday, February 15, 2012 10:59 AM

All replies

  • Hello Anja,

    what you are using in ESQL are not direct functions from TSQL. Those functions are called cannonical functions - shared set of functions translated to common functions in all database systems. Those functions don't operate on database directly. They operate on your entities. The list of cannonical functions in ESQL can be found here. You are probably looking for CreateDataTime() cannonical function.

    Best regards,
    Ladislav

    • Marked as answer by Anja Länge Wednesday, February 15, 2012 11:18 AM
    Wednesday, February 15, 2012 10:59 AM
  • Hi Ladislav,

    That's exactly what I was looking for. Thanks a lot!

    Wednesday, February 15, 2012 11:19 AM