I want to retrieve the next sequence number via an adhoc query in Entity Framework. I'm using:
LogEntities db = new LogEntities();
ObjectQuery<Int64> seq = db.CreateQuery<Int64>("SELECT AUDITLOG.EVENTID_SEQ.NEXTVAL from sysibm.sysdummy1");
This returns the following error:
ErrorDescription = "'sysibm.sysdummy1' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly."
I guess this is because sysdummy1 is not a mapped table in my model.
Anyone know a way I can perform this query using the LINQ 2 Entity context?