Hello
I want to delete all records that match with a criteria.
I saw DeleteWhere function but there is no argument for the SQL Criteria ?
Should i put it in SQLFilter property ?
If so, i suppose Delete function will erase the full table, even if SQLFilter property is set ?
Thanks
TUniTable DeleteWHERE
Re: TUniTable DeleteWHERE
Hello,
The DeleteWhere method deletes the WHERE clause in a query http://www.devart.com/unidac/docs/index ... here().htm
To add the WHERE condition, you can use AddWhere
http://www.devart.com/unidac/docs/devar ... tring).htm
In case you want to delete several records that meet a specific condition, you need to write a query manually, for instance:
The DeleteWhere method deletes the WHERE clause in a query http://www.devart.com/unidac/docs/index ... here().htm
To add the WHERE condition, you can use AddWhere
http://www.devart.com/unidac/docs/devar ... tring).htm
In case you want to delete several records that meet a specific condition, you need to write a query manually, for instance:
Code: Select all
UniConnection.ExecSQL('DELETE FROM TABLE WHERE condition');-
testpresta
- Posts: 32
- Joined: Sat 07 Jun 2014 19:41
Re: TUniTable DeleteWHERE
Thanks
Are you sure AddWhere method is not the same than setting FilterSQL Property ?
Are you sure AddWhere method is not the same than setting FilterSQL Property ?
Re: TUniTable DeleteWHERE
The FilterSQL property and the AddWHERE method both add the WHERE condition to an SQL query.
-
testpresta
- Posts: 32
- Joined: Sat 07 Jun 2014 19:41
Re: TUniTable DeleteWHERE
In fact i want to know what happens if a set a first filter with FilterSQL. Will AddWhere previous filters replaced ?
Thanks
Thanks
Re: TUniTable DeleteWHERE
No, when using the AddWhere method, the condition will be added to the existing filter.