From RAD Studio API Documentation
Jump to: navigation, search


property SQL: TStrings read FSQL write SetQuery;


__property System::Classes::TStrings* SQL = {read=FSQL, write=SetQuery};


Type Visibility Source Unit Parent
property published
Bde.DBTables TQuery


Contains the text of the SQL statement to execute for the query.

Use SQL to provide the SQL statement that a query component executes when its ExecSQL or Open method is called. At design time the SQL property can be edited by invoking the String List editor in the Object Inspector.

The SQL property may contain only one complete SQL statement at a time. In general, multiple "batch" statements are not allowed unless a particular server supports them.

The SQL property can be used to access

Paradox or dBASE tables, using local SQL. The allowable syntax is a subset of SQL-92. See the local SQL help file for information on supported syntax.

Databases on the Local InterBase Server, using standard SQL-92 and specific InterBase extensions to SQL syntax. For information on syntax and limitations, see the InterBase Language Reference and online help.

Databases on remote database servers using the appropriate SQL Links driver or ODBC (not available in all versions). Any standard statement in the server's SQL dialect is allowed. For information on SQL syntax and limitations, see the server documentation.

The SQL statement in the SQL property may contain replaceable parameters, following standard SQL-92 syntax conventions. Parameters are created and stored in the Params property.

Note: Developers with advanced versions can also invoke the Visual Query Builder to create an SQL statement for execution. Right-click the TQuery icon on the form in the IDE and select the command from the context menu.

See Also