TDAEBaseDataset

Overview

The TDAEDataset class is a specialization of the TDAESQLCommand class and implements the IDASQLCommand and IDADataset interfaces.

Location


 

constructor Create  override

Creates a new instance.

constructor Create(aConnection: IDAConnection; aDataset: TDataset; const aName: string)

Parameters:

  • aConnection: Connection
  • aDataset: Dataset
  • aName: Name

Active  protected

Specifies whether the dataset is currently active (open) or not. Setting this property to true will automatically open the dataset, while setting it to false will automatically close it.

property Active: Boolean read write

CachedParams  protected    (declared in TDAESQLCommand)

property CachedParams: TDictionary<string, Integer> read

CanUseNativeFieldData  protected safecall    (declared in TDAESQLCommand)

Specifies that given field can return data in GetNativeFieldData method

function CanUseNativeFieldData(Index: Integer): Boolean

Parameters:

  • Index: Required field index

Changed  protected

Indicates that SQL was changed and PrepareSQLStatement should be called

property Changed: Boolean read write

ClearParams  protected virtual    (declared in TDAESQLCommand)

Clears parameter values.

procedure ClearParams

Close  protected safecall

Closes the dataset

procedure Close

Connection  protected    (declared in TDAESQLCommand)

Presents the IDAConnection to access information about available databases, tables, columns, etc.

property Connection: IDAConnection read

ControlsDisabled  protected safecall

Indicates whether data-aware controls update their display to reflect changes to the dataset.

function ControlsDisabled: Boolean

CreateNativeDatabaseAccess  protected virtual    (declared in TDAESQLCommand)

Creates an IDANativeDatabaseAccess implementor.

function CreateNativeDatabaseAccess: IDANativeDatabaseAccess

CurrentRecIdValue  protected

not supported

property CurrentRecIdValue: Integer read write

Dataset    (declared in TDAESQLCommand)

Access to the standard VCL TDataSet.

property Dataset: TDataset read

DisableConstraints  protected safecall

Disables dataset constraints

procedure DisableConstraints

DisableControls  protected safecall

Disables data display in data-aware controls associated with the dataset.

procedure DisableControls

DoCreateNativeObject  protected virtual abstract    (declared in TDAESQLCommand)

Creates a object specific to the given connection.

function DoCreateNativeObject: TObject

DoExecute  protected virtual safecall abstract

Executes SQL statement

function DoExecute: Integer

DoGetActive  protected dynamic

Returns current state

function DoGetActive: Boolean

DoGetBOF  protected dynamic

Indicates whether reading the dataset has reached the beginning of the recordset (BOF = Beginning of File). GetBOF will only turn true if neither an empty dataset was opened nor Prior was called while the cursor was on the first record (it will not turn to true automatically when reaching the first record).

function DoGetBOF: Boolean

DoGetEOF  protected dynamic

Indicates whether reading the dataset has reached the end of the recordset (EOF = End of File). EOF will only turn true if neither an empty dataset was opened or Next was called while the cursor was already on the last record (it will not turn to true when reaching the last record).

function DoGetEOF: Boolean

DoGetRecordCount  protected dynamic

Returns the counf of records

function DoGetRecordCount: Integer

DoGetSQL  protected virtual safecall abstract

Gets the SQL statement

function DoGetSQL: string

DoLocate  protected dynamic

Locates and activates a record by key values.

function DoLocate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean

Parameters:

  • KeyFields: The semicolon-separated list of fields.
  • KeyValues: Values specified by the Variant or Variant array.
  • Options: Indicates whether the search is case insensitive and whether partial matches are supported.

DoNext  protected dynamic

Returns the result of the NativeDatabaseAccess.Next invocation. Please refer to the article How to create a Data Abstract Driver (Delphi) for more details.

procedure DoNext

DoPrepare  protected virtual safecall

Sets the property Prepared of the referred dataset to AValue.

procedure DoPrepare(Value: Boolean)

Parameters:

  • Value: state

DoSetActive  protected dynamic

Activates (True) or deactivates (False) the dataset. If the Value is true, the MacroProcessor of the active connection processes the Dynamic Where, retrieves and sets up the query parameters, activates the underlaid dataset (NativeDatabaseAccess) and binds the fields. If the Value is false, the underlaid dataset (NativeDatabaseAccess) is deactivated and the fields are unbound or cleared. Please refer to the article How to create a Data Abstract Driver (Delphi) for more details.

procedure DoSetActive(Value: Boolean)

Parameters:

  • Value: mode

DoSetSQL  protected virtual safecall abstract

Sets the SQL statement

procedure DoSetSQL(const Value: string)

Parameters:

  • Value: SQL statement

DynamicWhere  protected    (declared in TDAESQLCommand)

Implementation of Dynamic Where.

property DynamicWhere: TDAWhereBuilder read write

EnableConstraints  protected safecall

Enables dataset constraints

procedure EnableConstraints

EnableControls  protected safecall

Enables data display in data-aware controls associated with the dataset.

procedure EnableControls

Eof  protected

Indicates whether reading the dataset has reached the end of the recordset (EOF = End of File). EOF will only turn true if neither an empty dataset was opened or Next was called while the cursor was already on the last record (it will not turn to true when reaching the last record).

property Eof: Boolean read

Execute  protected override safecall

Executes the SQL command.

function Execute: Integer

FieldByName  protected safecall

Finds a field based on its name. If the specified field does not exist, FieldByName raises an exception.

function FieldByName(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

FieldCount  protected

Indicates the number of fields contained in the dataset.

property FieldCount: Integer read

Fields  protected

Provides access to all the fields contained in the dataset.

property Fields: TDAFieldCollection read

FieldValues  protected

Provides convenient access to all the fields values of the current record without having to go though the Fields collection property.

property FieldValues[Index: Integer]: Variant read

FindCachedParameter  protected    (declared in TDAESQLCommand)

function FindCachedParameter(const AParams: TParams; const AParamName: string): TParam

Parameters:

  • AParams:
  • AParamName:

FindField  safecall

Returns an item with the specified name.

function FindField(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

FindParameter  protected    (declared in TDAESQLCommand)

Finds the AParamName parameter in the |TParams collection.

function FindParameter(const AParams: TParams; const AParamName: string): TParam

Parameters:

  • AParams:
  • AParamName:

FixFMTBCDIssue  protected

Corrects a known issue with parameters that have ftFMTBcd type.

procedure FixFMTBCDIssue

FixKnownIssues  protected virtual

Fixes known problems. at this moment, it can call FixFMTBCDIssue if it is required

procedure FixKnownIssues

FreeBookmark  protected safecall

Frees the resources allocated for a specified bookmark.

procedure FreeBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: bookmark that should be freed

GetActive  protected safecall

Returns the result of the DoGetActive invocation.

function GetActive: Boolean

GetBOF  protected safecall

Indicates whether reading the dataset has reached the beginning of the recordset (BOF = Beginning of File). GetBOF will only turn true if neither an empty dataset was opened nor Prior was called while the cursor was on the first record (it will not turn to true automatically when reaching the first record).

function GetBOF: Boolean

GetBookMark  protected safecall

Allocates a bookmark for the active record

function GetBookMark: Pointer

GetCurrentMacroProcessor  protected virtual abstract

Returns instance of used macro processor.

function GetCurrentMacroProcessor: TDASQLMacroProcessor

GetDataset  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommand by returning the result of CreateDataset.

function GetDataset: TDataset

GetFieldValues  protected safecall

Returns value of data table's field specified by index

function GetFieldValues(Index: Integer): Variant

Parameters:

  • Index: index of the field

GetName  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommand by returning a value set in the constructor.

function GetName: string

GetNativeFieldData  protected override safecall

Sets the DataSize to the according field size value, allocates the Data memory and copies the content of the field.

function GetNativeFieldData(Index: Integer; var Buffer: TBytes): Boolean

Parameters:

  • Index: Required field index
  • Buffer:

GetNativeFieldDataType  protected safecall    (declared in TDAESQLCommand)

Returns the field type of the Index field

function GetNativeFieldDataType(Index: Integer): TFieldType

Parameters:

  • Index: field index

GetParams  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommand by returning the current parameters.

function GetParams: TDAParamCollection

GetParamValues  protected virtual safecall abstract    (declared in TDAESQLCommand)

Retrieves the values of the given parameters.

procedure GetParamValues(Params: TDAParamCollection)

Parameters:

  • Params: Parameters

GetParamValuesStd  protected    (declared in TDAESQLCommand)

Retrieves the values from Params2 for the daptOutput, daptInputOutput and daptResult parameters of Params1.

procedure GetParamValuesStd(Params1: TDAParamCollection; Params2: TParams)

Parameters:

  • Params1: Parameters guide
  • Params2: Values source

GetRowRecIDValue  protected

function GetRowRecIDValue: Integer

GotoBookmark  protected safecall

Positions on the record to which a specified bookmark points.

procedure GotoBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: record identified by this Bookmark should be active

intVCLTypeToDAType  protected virtual    (declared in TDAESQLCommand)

Gets mapping |TFieldType to TDADataType.

function intVCLTypeToDAType(aFieldType: TFieldType; ASize: Integer; ADecimalPrecision: Integer; aDecimalScale: Integer): TDADataType

Parameters:

  • aFieldType:
  • ASize:
  • ADecimalPrecision:
  • aDecimalScale:

isConnectioninRefreshFieldsMode  protected virtual abstract

Indicates the special mode in which (0=1) where statement is added to Dynamic Where.

function isConnectioninRefreshFieldsMode: Boolean

IsEmpty  protected

Indicates whether the dataset contains no records.

property IsEmpty: Boolean read

IsNeedToFixFMTBCDIssue  protected virtual

This is a virtual method (instrumental interface) to correct possible incompatibilities of the concrete implementation of the dataset (the known issue with the ZEOS driver). Please refer to the article How to create a Data Abstract Driver (Delphi) for more details.

function IsNeedToFixFMTBCDIssue: Boolean

IsTDatasetCompatible  protected safecall    (declared in TDAESQLCommand)

Returns true if data access object is TDataset descendant.

function IsTDatasetCompatible: Boolean

Locate  protected safecall

Locates and activates a record by key values.

function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean

Parameters:

  • KeyFields: The semicolon-separated list of fields.
  • KeyValues: Values specified by the Variant or Variant array.
  • Options: Indicates whether the search is case insensitive and whether partial matches are supported.

LogicalName  protected

Defines the name of the data table.

property LogicalName: string read write

Lookup  protected safecall

Returns the result of the NativeDatabaseAccess.Lookup invocation.

function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant

Parameters:

  • KeyFields: Comma-delimited list of fields
  • KeyValues: Variant or Variant array of values
  • ResultFields: Comma-delimited list of fields

Name  protected    (declared in TDAESQLCommand)

Returns a human-readable name for the command.

property Name: string read

Names  protected

Returns data table's field name specified by Index

property Names[Index: Integer]: string read

NativeDatabaseAccess  protected    (declared in TDAESQLCommand)

property NativeDatabaseAccess: IDANativeDatabaseAccess read

NativeFieldCount  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommandNativeObject by delegating the call to the FNativeDatabaseAccess member.

function NativeFieldCount: Integer

NativeFields  protected    (declared in TDAESQLCommand)

property NativeFields[Index: Integer]: IDANativeField read

NativeFindField  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommandNativeObject by delegating the call to the FNativeDatabaseAccess member.

function NativeFindField(const FieldName: string): IDANativeField

Parameters:

  • FieldName: name of the searched field

NativeObject  protected    (declared in TDAESQLCommand)

Access to the standard VCL |TObject which implements the data access.

property NativeObject: TObject read

Invokes DoNext.

procedure Next

OnAfterExecute    (declared in TDAESQLCommand)

Fires right after a command was executed.

property OnAfterExecute: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecute(const Sender: IDASQLCommand; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnAfterOpen

Fires after dataset was opened

property OnAfterOpen: TDAAfterOpenDatasetEvent read write
delegate: procedure OnAfterOpen(const Sender: IDADataset; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnBeforeExecute    (declared in TDAESQLCommand)

Fires before command execution

property OnBeforeExecute: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecute(const Sender: IDASQLCommand)

OnBeforeOpen

Fires before dataset was opened

property OnBeforeOpen: TDABeforeOpenDatasetEvent read write
delegate: procedure OnBeforeOpen(const Sender: IDADataset)

OnExecuteError    (declared in TDAESQLCommand)

Fires when exception is detected during command execution

property OnExecuteError: TDAExecuteCommandErrorEvent read write
delegate: procedure OnExecuteError(const Sender: IDASQLCommand; ActualSQL: string; Error: Exception)

OnOpenError

Fired if error was occured duting opening of dataset

property OnOpenError: TDAOpenDatasetErrorEvent read write
delegate: procedure OnOpenError(const Sender: IDADataset; ActualSQL: string; Error: Exception)

Open  protected safecall

Opens the dataset and prepares it for fetching records from the database.

procedure Open

OrderBy  protected

Represents the collection of OrderBy statements.

property OrderBy: TDAOrderByCollection read write

ParamByName  protected safecall    (declared in TDAESQLCommand)

Locates a specific parameter, based on its name. If no matching parameter is defined, an exception will be raised.

function ParamByName(const aName: string): TDAParam

Parameters:

  • aName: name of the parameter

Params  protected    (declared in TDAESQLCommand)

Provides access to the list of parameters defined for the command.

property Params: TDAParamCollection read

Prepared  protected    (declared in TDAESQLCommand)

Specifies whether the SQL statement has been prepared for execution on the database (true) or not (false). Setting this property to true will automatically prepare the statement. Preparing statements on the database server allows for faster execution, especially if the statement will be executed multiple times, as the server will not need to re-parse the SQL text for every execution. Please refer to your database system's documentation for more information on preparing statements.

Note that changing the SQL or Where properties will automatically un-prepare the statement.

property Prepared: Boolean read write

PrepareSQLStatement  protected override

Builds a well formed SQL instruction and prepares it via DoPrepare.

procedure PrepareSQLStatement

RecordCount  protected

Returns the count of records

property RecordCount: Integer read

RecreateCachedParams  protected    (declared in TDAESQLCommand)

procedure RecreateCachedParams(aParams: TParams)

Parameters:

  • aParams:

Refresh  protected safecall

Reopens the dataset.

procedure Refresh

RefreshParams  protected override safecall

Refreshes the list of parameters defined for the command based on the actual parameter names found in the SQL statement and Where clause.

procedure RefreshParams

RowRecIdValue  protected

Returns -1

property RowRecIdValue: Integer read

SetActive  protected safecall

Activates (True) or deactivates (False) the dataset.

procedure SetActive(Value: Boolean)

Parameters:

  • Value: mode

SetParamValues  protected virtual safecall abstract    (declared in TDAESQLCommand)

Converts values from Data Abstract TDAParam values.

procedure SetParamValues(Params: TDAParamCollection)

Parameters:

  • Params: parameters

SetParamValuesStd  protected    (declared in TDAESQLCommand)

Utility method to set the values of Params2 (|TParams) for the daptOutput, daptInputOutput and daptResult parameters of Params1 (TDAParamCollection).

procedure SetParamValuesStd(Params1: TDAParamCollection; Params2: TParams)

Parameters:

  • Params1: Parameters guide
  • Params2: Values holder

SQL  protected    (declared in TDAESQLCommand)

Defines the SQL statement to be executed.

property SQL: string read write

SQLContainsDynamicWhere  protected override safecall

Checks if SQL contains Dynamic Where macros.

function SQLContainsDynamicWhere: Boolean

State  protected

Determines the current operating mode of the dataset. The state property determines which operations can be performed with the data in the dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as the application processes data.

property State: TDatasetState read

WhereClause  protected

Where clause as plain string:

  (table.Field = 25) or (table.Field2 = "test")
property WhereClause: string read write

 

Active  protected

Specifies whether the dataset is currently active (open) or not. Setting this property to true will automatically open the dataset, while setting it to false will automatically close it.

property Active: Boolean read write

CachedParams  protected    (declared in TDAESQLCommand)

property CachedParams: TDictionary<string, Integer> read

Changed  protected

Indicates that SQL was changed and PrepareSQLStatement should be called

property Changed: Boolean read write

Connection  protected    (declared in TDAESQLCommand)

Presents the IDAConnection to access information about available databases, tables, columns, etc.

property Connection: IDAConnection read

CurrentRecIdValue  protected

not supported

property CurrentRecIdValue: Integer read write

Dataset    (declared in TDAESQLCommand)

Access to the standard VCL TDataSet.

property Dataset: TDataset read

DynamicWhere  protected    (declared in TDAESQLCommand)

Implementation of Dynamic Where.

property DynamicWhere: TDAWhereBuilder read write

Eof  protected

Indicates whether reading the dataset has reached the end of the recordset (EOF = End of File). EOF will only turn true if neither an empty dataset was opened or Next was called while the cursor was already on the last record (it will not turn to true when reaching the last record).

property Eof: Boolean read

FieldCount  protected

Indicates the number of fields contained in the dataset.

property FieldCount: Integer read

Fields  protected

Provides access to all the fields contained in the dataset.

property Fields: TDAFieldCollection read

FieldValues  protected

Provides convenient access to all the fields values of the current record without having to go though the Fields collection property.

property FieldValues[Index: Integer]: Variant read

IsEmpty  protected

Indicates whether the dataset contains no records.

property IsEmpty: Boolean read

LogicalName  protected

Defines the name of the data table.

property LogicalName: string read write

Name  protected    (declared in TDAESQLCommand)

Returns a human-readable name for the command.

property Name: string read

Names  protected

Returns data table's field name specified by Index

property Names[Index: Integer]: string read

NativeDatabaseAccess  protected    (declared in TDAESQLCommand)

property NativeDatabaseAccess: IDANativeDatabaseAccess read

NativeFields  protected    (declared in TDAESQLCommand)

property NativeFields[Index: Integer]: IDANativeField read

NativeObject  protected    (declared in TDAESQLCommand)

Access to the standard VCL |TObject which implements the data access.

property NativeObject: TObject read

OrderBy  protected

Represents the collection of OrderBy statements.

property OrderBy: TDAOrderByCollection read write

Params  protected    (declared in TDAESQLCommand)

Provides access to the list of parameters defined for the command.

property Params: TDAParamCollection read

Prepared  protected    (declared in TDAESQLCommand)

Specifies whether the SQL statement has been prepared for execution on the database (true) or not (false). Setting this property to true will automatically prepare the statement. Preparing statements on the database server allows for faster execution, especially if the statement will be executed multiple times, as the server will not need to re-parse the SQL text for every execution. Please refer to your database system's documentation for more information on preparing statements.

Note that changing the SQL or Where properties will automatically un-prepare the statement.

property Prepared: Boolean read write

RecordCount  protected

Returns the count of records

property RecordCount: Integer read

RowRecIdValue  protected

Returns -1

property RowRecIdValue: Integer read

SQL  protected    (declared in TDAESQLCommand)

Defines the SQL statement to be executed.

property SQL: string read write

State  protected

Determines the current operating mode of the dataset. The state property determines which operations can be performed with the data in the dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as the application processes data.

property State: TDatasetState read

WhereClause  protected

Where clause as plain string:

  (table.Field = 25) or (table.Field2 = "test")
property WhereClause: string read write

 

constructor Create  override

Creates a new instance.

constructor Create(aConnection: IDAConnection; aDataset: TDataset; const aName: string)

Parameters:

  • aConnection: Connection
  • aDataset: Dataset
  • aName: Name

CanUseNativeFieldData  protected safecall    (declared in TDAESQLCommand)

Specifies that given field can return data in GetNativeFieldData method

function CanUseNativeFieldData(Index: Integer): Boolean

Parameters:

  • Index: Required field index

ClearParams  protected virtual    (declared in TDAESQLCommand)

Clears parameter values.

procedure ClearParams

Close  protected safecall

Closes the dataset

procedure Close

ControlsDisabled  protected safecall

Indicates whether data-aware controls update their display to reflect changes to the dataset.

function ControlsDisabled: Boolean

CreateNativeDatabaseAccess  protected virtual    (declared in TDAESQLCommand)

Creates an IDANativeDatabaseAccess implementor.

function CreateNativeDatabaseAccess: IDANativeDatabaseAccess

DisableConstraints  protected safecall

Disables dataset constraints

procedure DisableConstraints

DisableControls  protected safecall

Disables data display in data-aware controls associated with the dataset.

procedure DisableControls

DoCreateNativeObject  protected virtual abstract    (declared in TDAESQLCommand)

Creates a object specific to the given connection.

function DoCreateNativeObject: TObject

DoExecute  protected virtual safecall abstract

Executes SQL statement

function DoExecute: Integer

DoGetActive  protected dynamic

Returns current state

function DoGetActive: Boolean

DoGetBOF  protected dynamic

Indicates whether reading the dataset has reached the beginning of the recordset (BOF = Beginning of File). GetBOF will only turn true if neither an empty dataset was opened nor Prior was called while the cursor was on the first record (it will not turn to true automatically when reaching the first record).

function DoGetBOF: Boolean

DoGetEOF  protected dynamic

Indicates whether reading the dataset has reached the end of the recordset (EOF = End of File). EOF will only turn true if neither an empty dataset was opened or Next was called while the cursor was already on the last record (it will not turn to true when reaching the last record).

function DoGetEOF: Boolean

DoGetRecordCount  protected dynamic

Returns the counf of records

function DoGetRecordCount: Integer

DoGetSQL  protected virtual safecall abstract

Gets the SQL statement

function DoGetSQL: string

DoLocate  protected dynamic

Locates and activates a record by key values.

function DoLocate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean

Parameters:

  • KeyFields: The semicolon-separated list of fields.
  • KeyValues: Values specified by the Variant or Variant array.
  • Options: Indicates whether the search is case insensitive and whether partial matches are supported.

DoNext  protected dynamic

Returns the result of the NativeDatabaseAccess.Next invocation. Please refer to the article How to create a Data Abstract Driver (Delphi) for more details.

procedure DoNext

DoPrepare  protected virtual safecall

Sets the property Prepared of the referred dataset to AValue.

procedure DoPrepare(Value: Boolean)

Parameters:

  • Value: state

DoSetActive  protected dynamic

Activates (True) or deactivates (False) the dataset. If the Value is true, the MacroProcessor of the active connection processes the Dynamic Where, retrieves and sets up the query parameters, activates the underlaid dataset (NativeDatabaseAccess) and binds the fields. If the Value is false, the underlaid dataset (NativeDatabaseAccess) is deactivated and the fields are unbound or cleared. Please refer to the article How to create a Data Abstract Driver (Delphi) for more details.

procedure DoSetActive(Value: Boolean)

Parameters:

  • Value: mode

DoSetSQL  protected virtual safecall abstract

Sets the SQL statement

procedure DoSetSQL(const Value: string)

Parameters:

  • Value: SQL statement

EnableConstraints  protected safecall

Enables dataset constraints

procedure EnableConstraints

EnableControls  protected safecall

Enables data display in data-aware controls associated with the dataset.

procedure EnableControls

Execute  protected override safecall

Executes the SQL command.

function Execute: Integer

FieldByName  protected safecall

Finds a field based on its name. If the specified field does not exist, FieldByName raises an exception.

function FieldByName(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

FindCachedParameter  protected    (declared in TDAESQLCommand)

function FindCachedParameter(const AParams: TParams; const AParamName: string): TParam

Parameters:

  • AParams:
  • AParamName:

FindField  safecall

Returns an item with the specified name.

function FindField(const aName: string): TDAField

Parameters:

  • aName: name of the searched field

FindParameter  protected    (declared in TDAESQLCommand)

Finds the AParamName parameter in the |TParams collection.

function FindParameter(const AParams: TParams; const AParamName: string): TParam

Parameters:

  • AParams:
  • AParamName:

FixFMTBCDIssue  protected

Corrects a known issue with parameters that have ftFMTBcd type.

procedure FixFMTBCDIssue

FixKnownIssues  protected virtual

Fixes known problems. at this moment, it can call FixFMTBCDIssue if it is required

procedure FixKnownIssues

FreeBookmark  protected safecall

Frees the resources allocated for a specified bookmark.

procedure FreeBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: bookmark that should be freed

GetActive  protected safecall

Returns the result of the DoGetActive invocation.

function GetActive: Boolean

GetBOF  protected safecall

Indicates whether reading the dataset has reached the beginning of the recordset (BOF = Beginning of File). GetBOF will only turn true if neither an empty dataset was opened nor Prior was called while the cursor was on the first record (it will not turn to true automatically when reaching the first record).

function GetBOF: Boolean

GetBookMark  protected safecall

Allocates a bookmark for the active record

function GetBookMark: Pointer

GetCurrentMacroProcessor  protected virtual abstract

Returns instance of used macro processor.

function GetCurrentMacroProcessor: TDASQLMacroProcessor

GetDataset  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommand by returning the result of CreateDataset.

function GetDataset: TDataset

GetFieldValues  protected safecall

Returns value of data table's field specified by index

function GetFieldValues(Index: Integer): Variant

Parameters:

  • Index: index of the field

GetName  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommand by returning a value set in the constructor.

function GetName: string

GetNativeFieldData  protected override safecall

Sets the DataSize to the according field size value, allocates the Data memory and copies the content of the field.

function GetNativeFieldData(Index: Integer; var Buffer: TBytes): Boolean

Parameters:

  • Index: Required field index
  • Buffer:

GetNativeFieldDataType  protected safecall    (declared in TDAESQLCommand)

Returns the field type of the Index field

function GetNativeFieldDataType(Index: Integer): TFieldType

Parameters:

  • Index: field index

GetParams  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommand by returning the current parameters.

function GetParams: TDAParamCollection

GetParamValues  protected virtual safecall abstract    (declared in TDAESQLCommand)

Retrieves the values of the given parameters.

procedure GetParamValues(Params: TDAParamCollection)

Parameters:

  • Params: Parameters

GetParamValuesStd  protected    (declared in TDAESQLCommand)

Retrieves the values from Params2 for the daptOutput, daptInputOutput and daptResult parameters of Params1.

procedure GetParamValuesStd(Params1: TDAParamCollection; Params2: TParams)

Parameters:

  • Params1: Parameters guide
  • Params2: Values source

GetRowRecIDValue  protected

function GetRowRecIDValue: Integer

GotoBookmark  protected safecall

Positions on the record to which a specified bookmark points.

procedure GotoBookmark(Bookmark: TBookmark)

Parameters:

  • Bookmark: record identified by this Bookmark should be active

intVCLTypeToDAType  protected virtual    (declared in TDAESQLCommand)

Gets mapping |TFieldType to TDADataType.

function intVCLTypeToDAType(aFieldType: TFieldType; ASize: Integer; ADecimalPrecision: Integer; aDecimalScale: Integer): TDADataType

Parameters:

  • aFieldType:
  • ASize:
  • ADecimalPrecision:
  • aDecimalScale:

isConnectioninRefreshFieldsMode  protected virtual abstract

Indicates the special mode in which (0=1) where statement is added to Dynamic Where.

function isConnectioninRefreshFieldsMode: Boolean

IsNeedToFixFMTBCDIssue  protected virtual

This is a virtual method (instrumental interface) to correct possible incompatibilities of the concrete implementation of the dataset (the known issue with the ZEOS driver). Please refer to the article How to create a Data Abstract Driver (Delphi) for more details.

function IsNeedToFixFMTBCDIssue: Boolean

IsTDatasetCompatible  protected safecall    (declared in TDAESQLCommand)

Returns true if data access object is TDataset descendant.

function IsTDatasetCompatible: Boolean

Locate  protected safecall

Locates and activates a record by key values.

function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean

Parameters:

  • KeyFields: The semicolon-separated list of fields.
  • KeyValues: Values specified by the Variant or Variant array.
  • Options: Indicates whether the search is case insensitive and whether partial matches are supported.

Lookup  protected safecall

Returns the result of the NativeDatabaseAccess.Lookup invocation.

function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant

Parameters:

  • KeyFields: Comma-delimited list of fields
  • KeyValues: Variant or Variant array of values
  • ResultFields: Comma-delimited list of fields

NativeFieldCount  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommandNativeObject by delegating the call to the FNativeDatabaseAccess member.

function NativeFieldCount: Integer

NativeFindField  protected safecall    (declared in TDAESQLCommand)

Implements IDASQLCommandNativeObject by delegating the call to the FNativeDatabaseAccess member.

function NativeFindField(const FieldName: string): IDANativeField

Parameters:

  • FieldName: name of the searched field

Invokes DoNext.

procedure Next

Open  protected safecall

Opens the dataset and prepares it for fetching records from the database.

procedure Open

ParamByName  protected safecall    (declared in TDAESQLCommand)

Locates a specific parameter, based on its name. If no matching parameter is defined, an exception will be raised.

function ParamByName(const aName: string): TDAParam

Parameters:

  • aName: name of the parameter

PrepareSQLStatement  protected override

Builds a well formed SQL instruction and prepares it via DoPrepare.

procedure PrepareSQLStatement

RecreateCachedParams  protected    (declared in TDAESQLCommand)

procedure RecreateCachedParams(aParams: TParams)

Parameters:

  • aParams:

Refresh  protected safecall

Reopens the dataset.

procedure Refresh

RefreshParams  protected override safecall

Refreshes the list of parameters defined for the command based on the actual parameter names found in the SQL statement and Where clause.

procedure RefreshParams

SetActive  protected safecall

Activates (True) or deactivates (False) the dataset.

procedure SetActive(Value: Boolean)

Parameters:

  • Value: mode

SetParamValues  protected virtual safecall abstract    (declared in TDAESQLCommand)

Converts values from Data Abstract TDAParam values.

procedure SetParamValues(Params: TDAParamCollection)

Parameters:

  • Params: parameters

SetParamValuesStd  protected    (declared in TDAESQLCommand)

Utility method to set the values of Params2 (|TParams) for the daptOutput, daptInputOutput and daptResult parameters of Params1 (TDAParamCollection).

procedure SetParamValuesStd(Params1: TDAParamCollection; Params2: TParams)

Parameters:

  • Params1: Parameters guide
  • Params2: Values holder

SQLContainsDynamicWhere  protected override safecall

Checks if SQL contains Dynamic Where macros.

function SQLContainsDynamicWhere: Boolean

 

OnAfterExecute    (declared in TDAESQLCommand)

Fires right after a command was executed.

property OnAfterExecute: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecute(const Sender: IDASQLCommand; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnAfterOpen

Fires after dataset was opened

property OnAfterOpen: TDAAfterOpenDatasetEvent read write
delegate: procedure OnAfterOpen(const Sender: IDADataset; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnBeforeExecute    (declared in TDAESQLCommand)

Fires before command execution

property OnBeforeExecute: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecute(const Sender: IDASQLCommand)

OnBeforeOpen

Fires before dataset was opened

property OnBeforeOpen: TDABeforeOpenDatasetEvent read write
delegate: procedure OnBeforeOpen(const Sender: IDADataset)

OnExecuteError    (declared in TDAESQLCommand)

Fires when exception is detected during command execution

property OnExecuteError: TDAExecuteCommandErrorEvent read write
delegate: procedure OnExecuteError(const Sender: IDASQLCommand; ActualSQL: string; Error: Exception)

OnOpenError

Fired if error was occured duting opening of dataset

property OnOpenError: TDAOpenDatasetErrorEvent read write
delegate: procedure OnOpenError(const Sender: IDADataset; ActualSQL: string; Error: Exception)