FieldCompareSetPredicate and views

Posts   
 
    
Posts: 67
Joined: 10-Jun-2009
# Posted on: 12-Jun-2009 13:16:01   

Is it possible to use a FieldCompareSetPredicate where the set of values is defined by a view.

Example query:


SELECT *
FROM Customers
WHERE customerId IN (SELECT CustomerId FROM v_Orders WHERE order_id = @id)

Posts: 67
Joined: 10-Jun-2009
# Posted on: 12-Jun-2009 13:19:22   

Another solution would be if I could add a relation between an Entity and a TypedView. Then the query would be something like this:


SELECT Customers.*
FROM Customers
INNER JOIN v_Orders ON Customers.CustomerId = v_Orders.CustomerId
WHERE v_Orders.order_id = @id

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Jun-2009 04:45:07   

You could also Map a view as an entity and create the relation at desinger, then you could use the FieldCompareSetPredicate.

David Elizondo | LLBLGen Support Team
Posts: 67
Joined: 10-Jun-2009
# Posted on: 14-Jun-2009 11:55:28   

Hmm, a clear case of RTM. Thank you for your reply.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 14-Jun-2009 19:57:37   

Give a try. If you encounter problems, please let us know.

David Elizondo | LLBLGen Support Team