Data.SqlExpr.TSQLDataSet

From RAD Studio API Documentation
Jump to: navigation, search

Data.SqlExpr.TCustomSQLDataSetData.DB.TDataSetSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTSQLDataSet

Delphi

TSQLDataSet = class(TCustomSQLDataSet)

C++

class PASCALIMPLEMENTATION TSQLDataSet : public TCustomSQLDataSet

Properties

Type Visibility Source Unit Parent
class public
Data.SqlExpr.pas
Data.SqlExpr.hpp
Data.SqlExpr Data.SqlExpr

Description

TSQLDataSet represents data retrieved using dbExpress.

TSQLDataSet is a general purpose unidirectional dataset for accessing database information using dbExpress. You can add a TSQLDataSet component to a form or data module at design time, or create one dynamically at run time.

Use TSQLDataSet to:

  • Represent the records in a database table, the result set of a SELECT query, or the result set returned by a stored procedure.
  • Execute a query or stored procedure that does not return a result set.
  • Represent metadata that describes what is available on the database server (tables, stored procedures, fields in a table, and so on).

TSQLDataSet is a unidirectional dataset. Unlike other datasets, unidirectional datasets do not buffer multiple records in memory. Because of this, you can only navigate using the First and Next methods. There is no built-in editing support: you can only edit the data in an SQL dataset by explicitly creating an SQL UPDATE command or by connecting the dataset to a client dataset using a provider. Features that require buffering multiple records, such as filters or lookup fields, are not available.

Before you can use a TSQLDataSet component, it must be connected to the database server. Therefore, the first step to take when working with TSQLDataSet is to set the SQLConnection property.

Once the dataset is connected to a server, you can use the Command Text editor to set the CommandText property if you are using the dataset to execute a query. To execute a stored procedure or represent a single database table, set the CommandType property and then choose the table or stored procedure name from a drop-down list on the CommandText property. If you want to access metadata with the SQL dataset, you must specify the metadata you want at run time by calling the SetSchemaInfo method.

DefaultRowsetSize is 20 (DefaultRowsetSize = 20). To use a different RowSetSize for existing Oracle database connections, manually add the RowSetSize property (for example, RowsetSize = 200) to dbxconnections.ini (Windows) or dbxconnections.conf (Linux). To have the RowSetSize property included in new connections, manually add the RowSetSize property to dbxdrivers.ini (Windows) or dbxdrivers.conf (Linux). RowsetSize can also be modified in code (for example, SQLConnection1.Params.Values['RowsetSize'] := '200'). Currently, only Oracle databases support this feature.

See Also