|
AnyDAC
|
Specifies a SQL statement to use to refetch a single record.
Set FetchRowSQL to a SQL statement to use when refetching single record from a database.
To submit a dataset original field value, use the :OLD_<field name> parameter name. Statement can use additional parameters and macros. To get access to the parameters or macros collection use Commands property.
If statement returns record field values using parameters, then use the :NEW_<field name> or :<field name> parameter name and set parameter type to ptInputOutput / ptOutput. If statement produces a result set, then it fields must have the same names as the dataset fields.
If UpdateOptions.RefreshMode is rmAll, then FetchRowSQL command will be executed automatically after posting a new record or changes to existing one to a database. In this case WHERE phrase must use :NEW_<field name> parameter names.
To create a SELECT statement at design time, use the UpdateSQL editor to create statements. For that double click on TADUpdateSQL component. Also, you can use stored procedure call or other SQL command to apply record fetching.
See the Commands property for details of how to use macros or additional parameters in the command text.
property FetchRowSQL: TStrings;
ADUpdateSQL1.FetchRowSQL := 'SELECT SHIPPERID, COMPANYNAME, PHONE FROM ADDEMO."Shippers" ' + 'WHERE SHIPPERID = :OLD_SHIPPERID';
|
What do you think about this topic? Send feedback!
|