TmySQLDirectQuery component is intended for high-speed (3-4 times faster than with using of
TmySQLQuery component) data fetching.
TmySQLDirectQuery 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.
TmySQLDirectQuery is usually used in tasks where data require some processing without
displaying it with/within visual DB-controls.
There are two nice examples of usage of this component:
Table2txt - This example shows how to save MySQL table data to a text file (one
record per line). Fields values are delimited by TAB
character. To increase performance we used TmySQLQueryDirect component.
TmySQLDirectQuery demo - allows you to compare TmySQLDirectQuery and TmySQLQuery performance
on data fetching
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
TmySQLDatabase.Execute() method. If you need to
get single value from database (1 row X 1 field resultset) you can use one of