TDAColumnMapping

Overview

The TDAColumnMapping class represents an individual column mapping for a specific statement.

Column mappings are used to map fields defined for a data table to specific field names in the back-end database, allowing one data table definition to be the front-end for different database tables.

Location

 

Assign  override

Copies data from a given source.

procedure Assign(aSource: TPersistent)

Parameters:

  • aSource: Instance whose properties will be copied

AssignFieldMapping

Assigns the DatasetField, SQLOrigin and TableField.

procedure AssignFieldMapping(aSource: TPersistent)

Parameters:

  • aSource: Instance whose properties will be copied

DatasetField

The data table field to which this mapping pertains.

property DatasetField: string read write

GetDisplayName  protected override

Returns the name of the column mapping as it appears in the collection editor.

function GetDisplayName: string

QueryInterface  protected stdcall    (declared in TInterfacedCollectionItem)

Returns a reference to a specified interface if the object supports that interface. This is one of the methods introduced by the IUnknown interface.

function QueryInterface(const IID: TGUID; out Obj: ): HResult

Parameters:

  • IID: Identifier of the interface to return
  • Obj: Variable to store the returned interface reference to

SQLOrigin

The name of the database column where the data for this field originates. In most cases, this will be identical to the field's name, unless the field was manually renamed or the original query for the data table uses the SQL "AS" keyword to rename fields, such as

SELECT Name AS UserName FROM ...

In the case above, SQLOrigin would be "UserName" while the TableField would be "Name".
The SQLOrigin property will be used to locate the right field in the recordset retrieved from the server, so it must match the output column name in the SELECT statement.

property SQLOrigin: string read write

TableField

The name of the recordset column containing the data for this field. In most cases, this will be identical to the field's Name, unless the field was manually renamed or the original query for the data table uses the SQL "AS" keyword to rename fields, such as

SELECT Name AS UserName FROM ...

In the above case, TableField would be "Name" while the SQLOrigin would be "UserName". The TableField property will be used as field-name in auto-generated INSERT, UPDATE and DELETE statements, as well as in SELECT statements generated by AutoSQL or Dynamic Where, so it must match the physical column in the data table.

property TableField: string read write

 

DatasetField

The data table field to which this mapping pertains.

property DatasetField: string read write

SQLOrigin

The name of the database column where the data for this field originates. In most cases, this will be identical to the field's name, unless the field was manually renamed or the original query for the data table uses the SQL "AS" keyword to rename fields, such as

SELECT Name AS UserName FROM ...

In the case above, SQLOrigin would be "UserName" while the TableField would be "Name".
The SQLOrigin property will be used to locate the right field in the recordset retrieved from the server, so it must match the output column name in the SELECT statement.

property SQLOrigin: string read write

TableField

The name of the recordset column containing the data for this field. In most cases, this will be identical to the field's Name, unless the field was manually renamed or the original query for the data table uses the SQL "AS" keyword to rename fields, such as

SELECT Name AS UserName FROM ...

In the above case, TableField would be "Name" while the SQLOrigin would be "UserName". The TableField property will be used as field-name in auto-generated INSERT, UPDATE and DELETE statements, as well as in SELECT statements generated by AutoSQL or Dynamic Where, so it must match the physical column in the data table.

property TableField: string read write

 

Assign  override

Copies data from a given source.

procedure Assign(aSource: TPersistent)

Parameters:

  • aSource: Instance whose properties will be copied

AssignFieldMapping

Assigns the DatasetField, SQLOrigin and TableField.

procedure AssignFieldMapping(aSource: TPersistent)

Parameters:

  • aSource: Instance whose properties will be copied

GetDisplayName  protected override

Returns the name of the column mapping as it appears in the collection editor.

function GetDisplayName: string

QueryInterface  protected stdcall    (declared in TInterfacedCollectionItem)

Returns a reference to a specified interface if the object supports that interface. This is one of the methods introduced by the IUnknown interface.

function QueryInterface(const IID: TGUID; out Obj: ): HResult

Parameters:

  • IID: Identifier of the interface to return
  • Obj: Variable to store the returned interface reference to

See Also