FireDAC.Stan.Option.TFDMapRule.TypeMask

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property TypeMask: String read FTypeMask write FTypeMask;

C++

__property System::UnicodeString TypeMask = {read=FTypeMask, write=FTypeMask};

Properties

Type Visibility Source Unit Parent
property published
FireDAC.Stan.Option.pas
FireDAC.Stan.Option.hpp
FireDAC.Stan.Option TFDMapRule

Description

Specifies the column data type mask.

Use the TypeMask property to specify a mask to match column data type. The mask uses the LIKE operator format, where:

  • '%' - many symbols
  • '_' - a single symbol

If a column name matches the mask, the column matches the map rule and will get the TargetDataType type. Other properties may be used to make the rule strict.

The TypeMask property is useful for the databases that support systems of domain based type, such as InterBase, Firebird and PostgreSQL. The meaning of the TypeMask property depends on the database (for InterBase, TypeMask corresponds to the domain name).

To use the TypeMask property in your application, add a new TFDMapRule:

var
  oRule: TFDMapRule;
...
  FDTable1.Disconnect;

  FDTable1.FormatOptions.OwnMapRules := True;
  oRule := FDTable1.FormatOptions.MapRules.Add;
  oRule.TypeMask := 'domain type name';
  oRule.SourceDataType := dtYyy; // source data type
  oRule.TargetDataType := dtXxx; // target data type

  FDTable1.Open;

See Also