[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
Object to execute SQL statements without result set.
Source position: sqldb.pp line 313
type TCustomSQLStatement = class(TComponent) end; |
||
public |
||
constructor Create(); override; |
|
Create a new instance of TCustomSQLStatement |
destructor Destroy; override; |
|
Destroy a TCustomSQLStatement instance. |
procedure Prepare; |
|
Prepare the statement for execution |
procedure Execute; |
|
Execute the SQL statement. |
procedure Unprepare; |
|
Unprepare a previously prepared statement |
function ParamByName(); |
|
Find a parameter by name |
function RowsAffected; virtual; |
|
Number of rows affected by the SQL statement. |
property Prepared: Boolean; [r] |
|
Is the statement prepared or not |
|
Object to execute SQL statements without result set. |
|
| | ||
| | ||
| | ||
TCustomSQLStatement is a light-weight object that can be used to execute SQL statements on a database. It does not support result sets, and has none of the methods that a TDataset component has. It can be used to execute SQL statements on a database that update data, execute stored procedures and DDL statements etc.
The TCustomSQLStatement is equivalent to TSQLQuery in that it supports transactions (in the Transaction property) and parameters (in the Params property) and as such is a more versatile tool than executing queries using TSQLConnection.ExecuteDirect.
To use a TCustomSQLStatement is simple and similar to the use of TSQLQuery: set the Database property to an existing connection component, and set the Transaction property. After setting the SQL property and filling Params, the SQL statement can be executed with the Execute method.
TCustomSQLStatement is a parent class. Many of the properties are only made public (or published) in the TSQLStatement class, which should be instantiated instead of the TCustomSQLStatement class.
|
Class to execute non-select SQL statements. |
|
|
Class to handle SQL commands (with or without result set) |
|
|
The transaction in which the SQL statement should be executed. |
|
|
List of parameters. |
|
Execute |
||
|
Database instance to execute statement on. |
|
|
Execute a piece of SQL code directly, using a Transaction if specified |