Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 1 (10.1) Part Number B10119-01 |
|
Applies To
Description
This method saves dynaset changes to the Oracle database.
Usage
oresult Update(void)
Remarks
For ODynaset, Update is the end of the three-part record editing sequence:
For OBinder, Update saves any changes that have been marked in the current record. This results in the same behavior as ODynaset::Update.
ODATABASE_ORAMODE determines precisely what happens to values of fields that have not been explicitly set. See ODatabase for details.
Calling Update sends OADVISE_UPDATE messages to all advisories attached to the dynaset. If the dynaset is being managed by an OBinder object, PreUpdate and PostUpdate triggers are called.
Note that once you call Update on a given row in a dynaset in a global transaction (that is once you issue a BeginTrans), locks will remain on the selected rows until you call commit the transaction or rollback.
Return Value
An oresult indicating whether the operation succeeded (OSUCCESS) or not (OFAILURE).
Example
This example sets the salary in the current record to $9985.
// we have a dynaset named empdyn
// edit the salary
empdyn.StartEdit();
empdyn.SetFieldValue("salary", 9985.0);
empdyn.Update();