TurboDB VCL Component Library


Previous  Top  Next

Replaces field values in a range of rows.

Delphi syntax:

procedure Replace(const Filter, Fields, Expressions: string): LongInt;

C++ syntax:

int __fastcall Replace(const AnsiString Filter, const AnsiString Fields, const AnsiString Expressions);


Replace sets the values of the Fields to the values calculated by Expressions for all records that meet the Filter's condition. The Expressions are evaluated in the context of each record.


The following example appends the digit nine to all phone numbers from Reading, GB:

Replace('Phone like "+44 118*", 'Phone', 'Phone + "9"');