New Posts New Posts RSS Feed: ParameterizedEsql and TOP or Take()
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

ParameterizedEsql and TOP or Take()

 Post Reply Post Reply
Author
chuckc View Drop Down
Groupie
Groupie


Joined: 27-Feb-2010
Posts: 54
Post Options Post Options   Quote chuckc Quote  Post ReplyReply Direct Link To This Post Topic: ParameterizedEsql and TOP or Take()
    Posted: 26-Aug-2011 at 11:38am
Is there some way to restrict the number of returned entities when using ParameterizedEsql?  Take() is not supported by PassthruEsqlQuery, and my first couple tries at using TOP embedded in the sql string weren't successful.

Thanks for any help.
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2011 at 12:38pm

Chuck,

It appears that in ESQL (and not just our implementation via PassThruEsqlQuery), you have to implement the ORDER BY keyword with LIMIT() to limit the number of responses returned. For example the following simple query is valid, and returns the expected results:
 

_em1 = new NorthwindIBEntities();

var query0 = new PassthruEsqlQuery(typeof(Customer),"SELECT VALUE c FROM Customers AS c order by c.CustomerID limit(5)");

var result0 = query0.With(_em1).Execute().Cast<Customer>();

Yours,
Robert
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down