SQL Delete equivalent

Posts   
 
    
Nikos
User
Posts: 1
Joined: 15-Apr-2008
# Posted on: 16-Apr-2008 00:02:37   

How do I accomplish the following SQL statement in LLBLGen Pro using the adapter. My Entity is called LockEntity.

SQL Server stmt:

Delete From Lock Where GetDate() > ExpirationTime

ExpirationTime is of type DateTime in SQL Server 2005.

Thanks in advance.

Nikos

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 16-Apr-2008 10:59:45   

Use the following DataAccessAdapter's method

DeleteEntitiesDirectly( 
   string entityName,
   IRelationPredicateBucket filterBucket
)

And in the RelationPredicateBucket.PredicateExpression you should add a **FieldComapreExpressionPredicate **in which you pass a **DBFunctionCall **for the GetDate as the expression parameter.