Top Previous Next

Since v2.4.0

TPSQLDirectQuery component is intended for high-speed (2-3 times faster than with using of TPSQLQuery component) data fetching.


TPSQLDirectQuery allows to execute SQL queries and retrieve resultsets with very high performance. Meanwhile, it is not TDataset-compatible. This means that it can't be assigned to TDatasource.Dataset property and you can't use it with visual DB-controls. TPSQLDirectQuery is usually used in tasks where data require some processing without displaying it with/within visual DB-controls.

There is nice example of usage of this component:
TPSQLDirectQuery demo - allows you to compare TPSQLDirectQuery and TPSQLQuery performance on data fetching.
You are welcome to download examples at http://microolap.com/products/connectivity/postgresdac/download/

This component is used only for fetching data. That means that you can run queries that return resultset (SELECT, EXPLAIN, SHOW and so) with this component. If you need to run data modification or administration queries (INSERT, CREATE TABLE, COMMIT and so on) you can use TPSQLDatabase.Execute() method.

See also: Properties, Methods