You don't need to set an identical condition for the properties FilterSQL and Filter. If you use FilterSQL, the filter will be appended to the WHERE clause of the SQL statement, in which case the server will send only the necessary records to the client, e.g.:
Code: Select all
CREATE TABLE DEPT (
DEPTNO int IDENTITY(1,1) NOT NULL,
DNAME varchar(20) NULL,
LOC varchar(20) NULL
)
Code: Select all
UniTable1.TableName := 'Dept';
UniTable1.FilterSQL := ' LOC = ''ENG'''
UniTable1.Open;
The query which is going to be executed on the server will look like this:
Code: Select all
SELECT * FROM Dept WHERE LOC = 'ENG'
The server will only retrieve records that match the condition LOC = 'ENG' from the table.
If you set a filter condition in the Filter property, the query will look like this:
In this case, all records of a table will be passed to the client by server for later filtering on the client side.
Data transferring over the network takes a lot of time, so the use of FilterSQL has the advantage of speed for large tables.
You can also filter the retrieved records using the Filter property.
More on FilterSQL:
https://www.devart.com/sdac/docs/devart ... tersql.htm