Show: Delphi C++
Display Preferences

FireDAC.Comp.Client.TFDUpdateSQL.ModifySQL

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ModifySQL: TStrings index 1 read GetSQL write SetSQL;

C++

__property System::Classes::TStrings* ModifySQL = {read=GetSQL, write=SetSQL, index=1};

Properties

Type Visibility Source Unit Parent
property published
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
FireDAC.Comp.Client TFDUpdateSQL

Description

Specifies the SQL statement to use when applying the update of a record.

Set UpdateSQL to the SQL statement to use when applying a record modification to a database. 

To submit a dataset original field value to a command, use the :OLD_<field name> parameter name. To submit a new field value to a command, use the :NEW_<field name> or :<field name> parameter name. Statement can use additional parameters and macros. To get access to the parameters or macros collection, use the Commands property. 

If the statement fetches new record field values (identified or modified in the trigger) using parameters, then use the :NEW_<field name> or :<field name> parameter name to include parameter values in the record, and set the parameter types to ptOuput. If the statement produces a result set, then its fields must have the same names as the dataset fields. 

To create an UPDATE statement at design time, use the UpdateSQL editor. For that, double-click the TFDUpdateSQL component. Also, you can use stored procedure calls or other SQL commands to apply modifications. 

See the Commands property for details on how to use macros or additional parameters in the command text.

Example

FDUpdateSQL1.InsertSQL := 'UPDATE ADDEMO."Shippers" SET SHIPPERID = :NEW_SHIPPERID, ' +
  'COMPANYNAME = :NEW_COMPANYNAME, PHONE = :NEW_PHONE WHERE SHIPPERID = :OLD_SHIPPERID';

See Also

Personal tools
In Other Languages
Previous Versions
Assistance