Page 1 of 1
TUniTable DeleteWHERE
Posted: Wed 09 Jul 2014 14:46
by testpresta
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
Re: TUniTable DeleteWHERE
Posted: Thu 10 Jul 2014 08:45
by AlexP
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:
Code: Select all
UniConnection.ExecSQL('DELETE FROM TABLE WHERE condition');
Re: TUniTable DeleteWHERE
Posted: Thu 10 Jul 2014 09:36
by testpresta
Thanks
Are you sure AddWhere method is not the same than setting FilterSQL Property ?
Re: TUniTable DeleteWHERE
Posted: Thu 10 Jul 2014 12:44
by AlexP
The FilterSQL property and the AddWHERE method both add the WHERE condition to an SQL query.
Re: TUniTable DeleteWHERE
Posted: Fri 11 Jul 2014 08:00
by testpresta
In fact i want to know what happens if a set a first filter with FilterSQL. Will AddWhere previous filters replaced ?
Thanks
Re: TUniTable DeleteWHERE
Posted: Mon 14 Jul 2014 08:53
by AlexP
No, when using the AddWhere method, the condition will be added to the existing filter.