Where clause with XML

Posts   
 
    
blaize
User
Posts: 2
Joined: 11-May-2009
# Posted on: 11-May-2009 09:42:18   

I'm trying to simulate this sort of where clause using LLBLGen....

WHERE [NetXML].exist('/email[@type = "email_1"]') >  0

The query is valid SQL.

I was using the ORMSupportClasses.Expression class to attempt to build a LeftOperand, GreaterThan, and RightOperand, but it wants a FieldCore object or something. I'm not trying to compare a field, but a value in a field to static value. Is there a way to do this???

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 11-May-2009 10:25:31   

Here are a couple of threads talking about eh same issue: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=5684 http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=8845

Basicly you'll need to implement your own predicate. Becaue XQuery is not supported out of the box.

blaize
User
Posts: 2
Joined: 11-May-2009
# Posted on: 11-May-2009 10:32:22   

Walaa wrote:

Here are a couple of threads talking about eh same issue: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=5684 http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=8845

Basicly you'll need to implement your own predicate. Becaue XQuery is not supported out of the box.

Right on...

I guess my question would be, how do I implement my own predicate? For instance, is there a way to simply pass a string a as predicate?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 11-May-2009 23:33:58   

You have to derive from any of the Predicate classes (eg. FieldCompareNullPredicate) and override the ToQueryText method.

Please read the threads I've posted above.