Data.DB.TDataSet.Insert

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Insert;

C++

HIDESBASE void __fastcall Insert(void);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Data.DB.pas
Data.DB.hpp
Data.DB TDataSet

Description

Inserts a new, empty record in the dataset.

Call Insert to:

  1. Open a new, empty record in the dataset.
  2. Set the active record to the new record.

After a call to Insert, an application can allow users to enter data in the fields of the record, and then post those changes to the database or change log using Post. (Client datasets can subsequently apply updates in the change log back to the database by calling ApplyUpdates.) A newly inserted record is posted in one of three ways:

  • For Paradox tables with primary indexes, the record is inserted into the dataset in a position based on its index.
  • For Paradox tables without primary indexes, the record is inserted into the dataset at the current position.
  • For dBASE, FoxPro, and Access tables, the record is physically appended to the dataset at the end. If an index happens to be active, the new record may appear in a position relative to the index, but the record is still actually stored at the end of the table.
  • For SQL databases, the physical location of the insert is implementation-specific. For indexed tables, the index is updated with the new record information.

After the new record is applied back to the database server, its physical location is database-specific. For indexed tables, the index is updated with the new record information.

See Also


Code Examples