Show: Delphi C++
Display Preferences

Data.SqlExpr.TCustomSQLDataSet.CommandText

From XE3 API Documentation
Jump to: navigation, search

Delphi

property CommandText: string read FCommandText write SetCommandText;

C++

__property System::UnicodeString CommandText = {read=FCommandText, write=SetCommandText};

Properties

Type Visibility Source Unit Parent
property public
Data.SqlExpr.pas
Data.SqlExpr.hpp
Data.SqlExpr TCustomSQLDataSet

Description

Specifies the command the dataset executes.

The value of CommandText depends on the CommandType property:

When CommandType is ctQuery, CommandText is an SQL statement that the dataset executes. If the statement is a SELECT statement, the SQL dataset executes the statement when it is opened. If the statement does not return a result set, the SQL dataset executes the statement when the ExecSQL method is called.

When CommandType is ctStoredProc, CommandText is the name of a stored procedure. The SQL dataset executes the stored procedure when it is opened or when the ExecSQL method is called, depending on whether the stored procedure returns a set of records.

When CommandType is ctTable, CommandText is the name of a table on the database server. The SQL dataset automatically generates a SELECT statement to fetch all the records on all the fields in this table, sorting by the fields listed in the SortFieldNames property. The generated statement is executed when the dataset is opened.

If CommandText is an SQL statement that includes parameters or the name of a stored procedure that has parameters, use the Params property to supply parameter values.

See Also

Personal tools
Translations